rollmean | R Documentation |
Computes the rolling mean of a vector of values x. I.e., the mean of a sliding window k values wide
rollmean(x, k)
x |
A vector of values. |
k |
Integer width of the rolling window. |
Equivalent function to the rollmean function in the zoo package, but much faster.
A vector of rolling means
x <- sample(1:1000000)
k <- 10000
rm <- rollmean(x,k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.