knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
tidyroll
makes it easy to work with irregular time slices for modeling and prediciton with tidymodels
.
The main function rolling_origin_nested()
is a wrapper around rsample::rolling_origin
and facilitates
rolling over different time units instead of a fixed window. The motivation for this function comes
from this vignette.
# install.packages("devtools") devtools::install_github("gacolitti/tidyroll")
suppressPackageStartupMessages(library(tidyroll)) suppressPackageStartupMessages(library(dplyr)) suppressPackageStartupMessages(library(rsample)) data("airquality2") roll <- rolling_origin_nested( data = airquality2, time_var = "date", unit = "month", start = "2017-08-01", end = "2017-11-01", assess = 1 ) roll analysis(roll$splits[[1]]) assessment(roll$splits[[1]]) analysis(roll$splits[[1]])$data %>% last() %>% tail() assessment(roll$splits[[1]])$data %>% first() %>% head()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.