suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(recipes))
len_out = 10
by_unit = "month"
start_date = as.Date("2021-01-01")
data_tbl <- tibble(
date_col = seq.Date(from = start_date, length.out = len_out, by = by_unit),
a = rnorm(len_out),
b = runif(len_out)
)
# Create a recipe object
rec_obj <- recipe(a ~ ., data = data_tbl) %>%
step_ts_acceleration(b)
# View the recipe object
rec_obj
# Prepare the recipe object
prep(rec_obj)
# Bake the recipe object - Adds the Time Series Signature
bake(prep(rec_obj), data_tbl)
rec_obj %>% prep() %>% juice()
Run the code above in your browser using DataLab