roll {litteR} | R Documentation |
Rolling Statistics
Description
Applies function fun
within a rolling (moving) window
of size w
to vector numeric vector x
.
Usage
roll(x, w = 3, fun = mean)
Arguments
x |
numeric vector (time-series) |
w |
width of moving window |
fun |
function to be applied |
Value
vector of length length(x)-w
[Package litteR version 1.0.0 Index]