rollMinMax: Rolling Minimum or Maximum over a Fixed Window

View source: R/rollMinMax.R

rollMinMaxR Documentation

Rolling Minimum or Maximum over a Fixed Window

Description

This implementation is minimal without error checking, or NA handling. It is taken from the ichimoku package which had several more complicated variants, and is reused here with just tidyCpp.

Usage

rollMinMax(x, window, min = TRUE)

Arguments

x

A numeric vector.

window

An interger with the size of the rolling window.

min

A logical which, if true, selects minimum, else maximum

Details

The ichimoku variant is by Charlie Gao and credits Andrew Uhl for the initial implementation.

Value

A vector of the same length as 'x' with elements 1 to (length(window) - 1) containing NAs.

Author(s)

Dirk Eddelbuettel for this version, R Core for the underlying code


dang documentation built on May 29, 2024, 2:53 a.m.