# NOT RUN {
library(lubridate)
examples <- data.frame(Dan = ymd("2002-03-04") + days(1:10),
Stefan = ymd("2006-01-13") + days(1:10))
date_rec <- recipe(~ Dan + Stefan, examples) %>%
step_date(all_predictors())
tidy(date_rec, number = 1)
date_rec <- prep(date_rec, training = examples)
date_values <- bake(date_rec, new_data = examples)
date_values
tidy(date_rec, number = 1)
# }
Run the code above in your browser using DataLab