Description Usage Arguments Details Value
Compute a moving average using prior or later elements
1 | tsData.ma <- getMA(tsData,N)
|
tsData |
A time series object. |
N |
An integer indicating how many prior or later elements to include. |
direction |
A string indicating which elements to use to compute the moving average relative to each point. Valid values are "prior" and "later". |
If N is null and direction is "prior", then the current point and all prior points are used in the compuation. If N is null and direction is "later", then the current point and all later points are used in the computation. If N is not null, then an N point moving average is computed in the direction specified (default is "prior"). In any case, a one-sided (non-centered) moving average is computed. If direction is "prior", then the current point and the prior N-1 points are included in the computation. If direction is "later", then the current point and the later N-1 points are included in the computation. If there are not enough points to compute an N-point MA, then the original values are retained.
A time series of moving averages
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.