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.

# S3 method for recipe
formula(x, ...)

Arguments

x

A recipe object where all steps have been prepared.

...

Note currently used.

Value

A formula.

Examples

formula(recipe(Species + Sepal.Length ~ ., data = iris))
#> Species + Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width #> <environment: 0x7ff6900a5150>
iris_rec <- recipe(Species ~ ., data = iris) %>% step_center(all_numeric()) %>% prep(training = iris) formula(iris_rec)
#> Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width #> <environment: 0x7ff692ce70b8>