library(dplyr)
library(rsample)
FB_tbl <- FANG %>%
filter(symbol == "FB") %>%
select(symbol, date, adjusted)
resample_spec <- time_series_cv(
FB_tbl,
initial = "1 year",
assess = "6 weeks",
skip = "3 months",
lag = "1 month",
cumulative = FALSE,
slice_limit = 6
)
resample_spec %>% tk_time_series_cv_plan()
resample_spec %>%
tk_time_series_cv_plan() %>%
plot_time_series_cv_plan(
date, adjusted, # date variable and value variable
# Additional arguments passed to plot_time_series(),
.facet_ncol = 2,
.line_alpha = 0.5,
.interactive = FALSE
)
Run the code above in your browser using DataLab