Description Usage Arguments Value Examples
Apply rolling operations over a moving window for size n
and increment step
.
1 2 3 |
x |
Univariate vector, numeric or ts object with only one dimension. |
fn |
|
n |
Window size. |
fill |
Numeric value(s) or function used to fill observations. |
align |
Specifying whether the index of the result should be left- or right-aligned or centered (default) compared to the rolling window of observations. |
... |
Additional arguments passed to the function |
roll()
returns a vector with the same class and attributes as the input vector.
roll_data()
Returns a list of length length(x)/step.
1 | x <- seq(10, 1, -1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.