rolling_groups: Loop along a vector, returning n elements at a time in a list

View source: R/RcppExports.R

rolling_groupsR Documentation

Loop along a vector, returning n elements at a time in a list

Description

Loop along a vector, returning n elements at a time in a list

Usage

rolling_groups(values, n = 2L)

Arguments

values

IntegerVector. The vector to loop along

n

int. The number of elements to return in each element of the resulting list

Value

a list in which each element contains n elements from values

Note

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

See Also

get_indices

Examples

groups <- rolling_groups(0:50, 3)
head(groups)
tail(groups)

PAutilities documentation built on Aug. 21, 2022, 9:05 a.m.