get_indices: Retrieve indices for a rolling window analysis

View source: R/RcppExports.R

get_indicesR Documentation

Retrieve indices for a rolling window analysis

Description

Retrieve indices for a rolling window analysis

Usage

get_indices(y_var, window_size = 15L)

Arguments

y_var

NumericVector. Input on which to define the indices for each roll of the window

window_size

int. The size of the window

Value

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

Note

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

See Also

rolling_groups

Examples

result <- get_indices(1:100, 10)
head(result)
tail(result)

paulhibbing/PAutilities documentation built on Sept. 12, 2022, 1:46 a.m.