add_recipe: Add a recipe to a workflow

Description Usage Arguments Details Value Examples

View source: R/pre-action-recipe.R

Description

Usage

1
2
3
4
5
add_recipe(x, recipe, ..., blueprint = NULL)

remove_recipe(x)

update_recipe(x, recipe, ..., blueprint = NULL)

Arguments

x

A workflow

recipe

A recipe created using recipes::recipe()

...

Not used.

blueprint

A hardhat blueprint used for fine tuning the preprocessing.

If NULL, hardhat::default_recipe_blueprint() is used.

Note that preprocessing done here is separate from preprocessing that might be done automatically by the underlying model.

Details

To fit a workflow, one of add_formula() or add_recipe() must be specified, but not both.

Value

x, updated with either a new or removed recipe preprocessor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(recipes)
library(magrittr)

recipe <- recipe(mpg ~ cyl, mtcars) %>%
  step_log(cyl)

workflow <- workflow() %>%
  add_recipe(recipe)

workflow

remove_recipe(workflow)

update_recipe(workflow, recipe(mpg ~ cyl, mtcars))

workflows documentation built on July 8, 2020, 6:51 p.m.