RcppRoll (version 0.1.0)

roll_sum: Rolling Sum

Description

This function implements a rolling sum with C++/Rcpp.

Usage

roll_sum(x, n, by.column = TRUE, weights = rep(1, n),
    normalize = FALSE)

Arguments

x
An Robject of form: numeric vector, numeric matrix.
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 numeric vector of weights of same length as n.
normalize
boolean; if TRUE, we normalize the weight of vectors supplied.