terms_select()
has been deprecated in favor of recipes_eval_select()
.
This function bakes the step function selectors and might be useful when creating custom steps.
Arguments
- terms
A list of formulas whose right-hand side contains quoted expressions. See
rlang::quos()
for examples.- info
A tibble with columns
variable
,type
,role
, andsource
that represent the current state of the data. The functionsummary.recipe()
can be used to get this information from a recipe.- empty_fun
A function to execute when no terms are selected by the step. The default function throws an error with a message.
Value
A character string of column names or an error of there are no selectors or if no variables are selected.
Examples
library(rlang)
library(modeldata)
data(okc)
rec <- recipe(~ ., data = okc)
info <- summary(rec)
terms_select(info = info, quos(all_predictors()))
#> Warning: `terms_select()` was deprecated in recipes 0.1.17.
#> Please use `recipes_eval_select()` instead.
#> [1] "age" "diet" "height" "location" "date" "Class"