runMean | R Documentation |
Compute the running mean of a vector
runMean(v, lags = 0, group = NULL, filter = NULL)
v |
a numeric vector |
lags |
an integer vector giving lag numbers |
group |
a factor or a list of factors defining groups of observations |
filter |
a vector specifying a linear filter |
## Ten day "time series" x <- rnorm(10) ## Running mean of lag 0, 1, and 2 runMean(x, 0:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.