Description Usage Arguments Value Methods (by class)
Generate resample objects of rolling windows over elements of a data frame.
1 2 3 4 5 6 7 8 9 10 11 | roll(data, ...)
## S3 method for class 'data.frame'
roll(data, width = 1L, align = c("left", "right",
"center"), partial = TRUE, indices = NULL, from = 1L, to = n,
by = 1L, offsets = NULL, ...)
## S3 method for class 'grouped_df'
roll(data, width = 1L, align = c("left", "right",
"center"), partial = TRUE, indices = NULL, from = 1L, to = n,
by = 1L, offsets = NULL, ...)
|
data |
A data frame |
... |
Arguments passed to methods |
width |
The window width. |
align |
Is the window left-aligned, right-aligned, or centered relative to the reference index of the window. |
partial |
logical or numeric. If |
indices, from, to, by |
The indices at which to generate windows. If
|
offsets |
An integer vector or |
A data frame with rows equal to the number of windows and the following columns:
A list of resample
objects. Training sets.
A list of resample
objects. Test sets.
An integer vector of identifiers
data.frame
: Generate windows from the rows of the data frame.
grouped_df
: Generate windows from the groups of the data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.