MovingAverage: MovingAverage

View source: R/MovingAverage.R

MovingAverageR Documentation

MovingAverage

Description

Moving Average - A lowpass filter

Usage

MovingAverage(Data, lag,PlotIt=FALSE)

Arguments

Data

[1:n,1] time series, in colunns

lag

nr or previous data points to average

PlotIt

default (FALSE), if TRUE, comparison plot is generated

Value

FilteredData[1:n,1] the filtered data

Note

Because of the way endpoints are handled, the result of signal::filter differs from the result returned by the smooth function.

Author(s)

Michael Thrun

Examples

data("ElectricityBRD")
averagedVals = MovingAverage(ElectricityBRD$Mrd_KWh, 12, PlotIt=TRUE)

Mthrun/TSAT documentation built on Feb. 5, 2024, 11:15 p.m.