Description
Applies function fun
within a rolling (moving) window
of size w
to vector numeric vector x
.
Usage
roll(x, w = 3, fun = mean)
Value
vector of length length(x)-w
Arguments
- x
numeric vector (time-series)
- w
width of moving window
- fun
function to be applied