rolling_groups | R Documentation |
Loop along a vector, returning n elements at a time in a list
rolling_groups(values, n = 2L)
values |
IntegerVector. The vector to loop along |
n |
int. The number of elements to return in each element of the resulting list |
a list in which each element contains n
elements from
values
For this function, the output elements contain raw values from
values
, whereas for get_indices
the output elements
contain the positions (i.e., indices) rather than the raw values
get_indices
groups <- rolling_groups(0:50, 3) head(groups) tail(groups)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.