runMean: Compute Running Means

View source: R/tsModelSpec.R

runMeanR Documentation

Compute Running Means

Description

Compute the running mean of a vector

Usage

runMean(v, lags = 0, group = NULL, filter = NULL)

Arguments

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

Examples

## Ten day "time series"
x <- rnorm(10)

## Running mean of lag 0, 1, and 2
runMean(x, 0:2)


rdpeng/tsmodel documentation built on May 18, 2022, 5:52 a.m.