GetWindowExtremes: Moving window maxima

Description Usage Arguments Examples

Description

returns max(x[(i - k):(i + k)]) for i = 1,...,n or (min(...))

Usage

1
GetWindowExtremes(x, k, type = c("max", "min"))

Arguments

x

numeric data vector

k

integer window size (use e.g. 2L)

type

string type of extreme

Examples

1
2
3
x <- c(1, 2, 3, 2, 5, 0, 2, 3, 8)
GetWindowExtremes(x, 2L, "max")
GetWindowExtremes(x, 2L, "min")

MartinRoth/knmipluim documentation built on May 7, 2019, 3:39 p.m.