rollmeanp: Rolling Mean

Description Usage Arguments Details Examples

Description

Rolling mean that includes partial results from the beginning and end

Usage

1
rollmeanp(x, w = 5, front = TRUE)

Arguments

x

numeric; data vector

w

integer; width of the rolling window

front

logical; when w is odd, should the new values be biased to the front?

Details

Wrapper/extension for TTR::runMean()

Examples

1
2
3
4
xx <- c(3, 8, 5, 9, 6, 3, 8, 2, 5, 1)
plot(xx)
lines(rollmeanp(xx, w=4, front=TRUE), col="blue")
lines(rollmeanp(xx, w=4, front=FALSE), col="red")

AkselA/R-rollfun documentation built on May 31, 2019, 8:41 a.m.