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.

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
library(recipes)

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

workflow <- workflow()
workflow <- add_recipe(workflow, recipe)
workflow

remove_recipe(workflow)

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

tidymodels/workflows documentation built on Jan. 3, 2020, 4:47 a.m.