get_indices | R Documentation |
Retrieve indices for a rolling window analysis
get_indices(y_var, window_size = 15L)
y_var |
NumericVector. Input on which to define the indices for each roll of the window |
window_size |
int. The size of the window |
a list in which each element contains window_size
consecutive
integers that indicate which elements of y_var
would be extracted
for that roll of the window
For this function, the output elements contain positions (i.e., indices) from
y_var
, whereas for rolling_groups
the output elements
contain the raw values found at each index
rolling_groups
result <- get_indices(1:100, 10) head(result) tail(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.