
Last chance! 50% off unlimited learning
Sale ends in
Perform tiling windows on a tsibble by row
tile_tsibble(.x, .size = 1, .id = ".id")
A tsibble.
A positive integer for window size.
A character naming the new column .id
containing the partition.
slide_tsibble()
, tile_tsibble()
, and stretch_tsibble()
provide fast
and shorthand for rolling over a tsibble by observations. That said, if the
supplied tsibble has time gaps, these rolling helpers will ignore those gaps
and proceed.
They are useful for preparing the tsibble for time series cross validation.
They all return a tsibble including a new column .id
as part of the key. The
output dimension will increase considerably with slide_tsibble()
and
stretch_tsibble()
, which is likely to run out of memory when the data is
large. Alternatively, you could construct cross validation using pslide()
and pstretch()
to avoid the memory issue.
Other rolling tsibble: slide_tsibble
,
stretch_tsibble
# NOT RUN {
harvest <- tsibble(
year = rep(2010:2012, 2),
fruit = rep(c("kiwi", "cherry"), each = 3),
kilo = sample(1:10, size = 6),
key = fruit, index = year
)
harvest %>%
tile_tsibble(.size = 2)
# }
Run the code above in your browser using DataLab