I'm using the recipes
package from tidymodels
. I'm trying to update_role
for a few columns at the same time. Example:
library(recipes)
library(dplyr)
cols_to_update = list()
cols_to_update[["a"]] <- c("mpg", "cyl")
mtcars %>%
recipe() %>%
update_role(cols_to_update[["a"]], new_role = "new_role")
I get error Error: Not all functions are allowed in step function selectors (e.g.
c). See ?selections.
Here's documentation for selections.
There's no way I can type all of them by hand.