recipes_ptype_validate: Validate prototype of recipe object

View source: R/ptype.R

recipes_ptype_validateR Documentation

Validate prototype of recipe object

Description

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.

See Also

developer_functions recipes_ptype

Examples

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

recipes_ptype_validate(rec, mtcars)


tidymodels/recipes documentation built on Nov. 29, 2024, 3:05 p.m.