Search code examples
rmoving-average

Calculating moving average


I'm trying to use R to calculate the moving average over a series of values in a matrix. There doesn't seem to be a built-in function in R that will allow me to calculate moving averages. Do any packages provide one? Or do I need to write my own?


Solution

    • Rolling Means/Maximums/Medians in the zoo package (rollmean)
    • MovingAverages in TTR
    • ma in forecast