rollit_example {RcppRoll}R Documentation

'rollit' Output – Example Function

Description

This presents the function signature for the output of rollit.

Usage

rollit_example(x, n, by.column, weights, normalize = FALSE)

Arguments

x

A vector/matrix of numeric type.

n

integer; the window / subset size to roll over.

by.column

boolean; if TRUE we loop over columns, otherwise we loop over rows.

weights

a vector of length n; specify the weighting to assign to each element in the window.

normalize

boolean; if TRUE we normalize the weights to sum to 1.

Value

This function does not return anything; it merely exists as a skeleton to provide documentation for your own rollit generated functions.

Note

Elements in weights equal to 0 are skipped, so that e.g. setting weights = c(1,0,1,0,1) would skip every 2nd and 4th element in each length-5 window.

See Also

rollit


[Package RcppRoll version 0.2.2 Index]