roll: Rolling Statistics

View source: R/stats.R

rollR 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


litteR documentation built on Aug. 8, 2025, 7:31 p.m.