rolling: Rolling aggregate functions

Description Usage Arguments Details References Examples

Description

Functions for calculating different rolling aggregates.

Usage

1
rolling.sum(x, w, type = "lag", na.rm = FALSE)

Arguments

x

An atomic vector of class numeric.

w

An integer value specifying the width of the windows over which to calculate the rolling aggregate.

type

Either one of "lag" (window ends with current observation), "mid" (current observation is in the middle of the window) or "lead" (window starts with current observation).

na.rm

A logical value indicating whether NA values should be ignored when calculating the rolling aggregates.

Details

References

Sheskin, D.J. (2000) Handbook of Parametric and Nonparametric Statistical Procedures, Second Edition. Boca Raton, Florida: Chapman & Hall/CRC.

Joanes, D. N. and Gill, C. A. (1998), Comparing measures of sample skewness and kurtosis. Journal of the Royal Statistical Society: Series D (The Statistician), 47: 183-189. doi:10.1111/1467-9884.00122

Examples

1
2
x <- rnorm(100)
rolling.sum(x = x, w = 10)

kaldhusdal/temporal documentation built on Nov. 24, 2019, 11:19 p.m.