Skip to content

This helper function validates a dataframe against the ptype of a recipe.

Usage

recipes_ptype_validate(
  x,
  new_data,
  ...,
  stage = "prep",
  call = rlang::caller_env()
)

Arguments

x

A recipe object.

new_data

A data.frame. To be patched aganist ptype of x.

...

currently not used.

stage

A single character. Must be one of "prep" or "bake". See details for more. Defaults to "prep".

call

The execution environment of a currently running function, e.g. caller_env(). The function will be mentioned in error messages as the source of the error. See the call argument of rlang::abort() for more information.

Value

Nothing or an error.

Examples

rec <- recipe(mpg ~ disp, data = mtcars)

recipes_ptype_validate(rec, mtcars)