View source: R/MovingAverage.R
MovingAverage | R Documentation |
Moving Average - A lowpass filter
MovingAverage(Data, lag,PlotIt=FALSE)
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 |
FilteredData[1:n,1] the filtered data
Because of the way endpoints are handled, the result of signal::filter differs from the result returned by the smooth function.
Michael Thrun
data("ElectricityBRD")
averagedVals = MovingAverage(ElectricityBRD$Mrd_KWh, 12, PlotIt=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.