View source: R/movingAverages.R
sma | R Documentation |
An implementation of the basic simple moving average. A sample mean is computed over a moving window of a given time series.
sma(x, n = 30)
x |
the time-series of observations |
n |
the length of the moving window to average over (positive integer) |
An error is returned if the length of the moving window is larger than the sample size of the data.
vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.