formula.recipe: Create a Formula from a Prepared Recipe

Description Usage Arguments Value Examples

View source: R/formula.R

Description

In case a model formula is required, the formula method can be used on a recipe to show what predictors and outcome(s) could be used.

Usage

1
2
## S3 method for class 'recipe'
formula(x, ...)

Arguments

x

A recipe object where all steps have been prepared.

...

Note currently used.

Value

A formula.

Examples

1
2
3
4
5
6
formula(recipe(Species + Sepal.Length ~ ., data = iris))

iris_rec <- recipe(Species ~ ., data = iris) %>%
  step_center(all_numeric()) %>%
  prep(training = iris)
formula(iris_rec)

recipes documentation built on July 2, 2020, 4:02 a.m.