recipe(~., data = iris) %>%
step_rename(Sepal_Width = Sepal.Width) %>%
prep() %>%
bake(new_data = NULL) %>%
slice(1:5)
vars <- c(var1 = "cyl", var2 = "am")
car_rec <-
recipe(~., data = mtcars) %>%
step_rename(!!!vars)
car_rec %>%
prep() %>%
bake(new_data = NULL)
car_rec %>%
tidy(number = 1)
Run the code above in your browser using DataLab