rollapply: Rolling window apply

View source: R/primitives.R

rollapplyR Documentation

Rolling window apply

Description

Rolling window apply

Usage

rollapply(
  x,
  width,
  FUN,
  ...,
  align = c("right", "left", "center"),
  fill = NA,
  partial = FALSE
)

Arguments

x

An atomic vector.

width

Target width, in characters or rolling-window size depending on the function.

FUN

Function applied to each rolling window.

...

Additional arguments (unused, or passed through depending on the function).

align

Alignment of the rolling window relative to each position.

fill

Value used for positions where no window/result is available.

partial

Allow partial windows at the boundaries.

Value

A vector with one result per window.


basetable documentation built on Sept. 18, 2026, 9:13 a.m.