ma: A Moving Average Filter Function

Description Usage Arguments Value Examples

View source: R/ma.R

Description

This function computes the centered moving average for filtering.

Usage

1
ma(alpha, data, windowed = F)

Arguments

alpha

a number that denotes the one-sided window length of the filter.

data

a numeric vector to apply the filter

windowed

a logical that defaults to FALSE. If true, then it will apply correction for bias caused by seasonal behaviors.

Value

A numeric vector containing the filtered data

Examples

1
2
ma(2, mydata)
ma(6, mydata, T)

kobyeongmin/ma documentation built on Jan. 29, 2021, 1:30 p.m.