ma | R Documentation |
This function returns a (by default) seven-day moving average of the variable passed in. Make sure the data is pre-sorted by date, and grouped by the appropriate grouping. The data should have no gaps in time.
ma(x, n = 7)
x |
The variable to calculate the moving average of. |
n |
The number of lags to cover in the moving average. |
ma(1:9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.