Rolling Maximum¶
Computes the rolling maximum over a numeric vector using a monotonic deque.
Usage¶
rolling_max(x, window_size, min_periods = window_size)
Parameters¶
Parameter |
Description |
|---|---|
|
A numeric vector of type double. |
|
Positive integer window length. |
|
Minimum number of non- |
Returns¶
A numeric vector with rolling maximum values.
Examples¶
x <- as.double(c(1, 3, 2, 5, 4))
rolling_max(x, 3L)