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)


recipes documentation built on July 4, 2024, 9:06 a.m.