Skip to contents

A recipes::recipe() step that adds role information and the recipe itself as an attribute of the baked or juiced output.

Usage

step_include_roles(
  recipe,
  roles = NULL,
  trained = FALSE,
  skip = FALSE,
  role = NA,
  id = recipes::rand_id("include_roles")
)

Arguments

recipe

A recipe object. The step will be added to the sequence of operations for this recipe.

roles

a data.frame with role information for each term created by the recipe.

trained

A logical to indicate if the quantities for preprocessing have been estimated.

skip

A logical. Should the step be skipped when the recipe is baked by bake()? While all operations are baked when prep() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations.

role

Not used by this step since no new variables are created.

id

A character string that is unique to this step to identify it.

Details

This step must be used as the last step in a recipe.