View source: R/moving_averages.R
SMA | R Documentation |
compute the Simple Moving Average of a vector.
SMA(x = NULL, n = 10, .fun = mean, na.rm = TRUE)
x |
numeric vector. |
n |
integer, the number of length of the moving average. |
.fun |
function, the function to use, for example |
na.rm |
logical, |
a vector of the same length of x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.