Computing moving average of all past values including last value using a window size

ma(z, window_size = 5L)

Arguments

z

the numeric vector

window_size

the integer window size

Value

a vector of the same length pre-padded with NAs