Learn R Programming

dateutils (version 0.1.5)

rollmax: Rolling Max

Description

Find the rolling maximum in `x` with span `n`

Usage

rollmax(x, n)

Arguments

x

Numeric vector

n

Integer span

Value

The maximum value of `x` with span `n`

Examples

Run this code
# NOT RUN {
rollmax(c(1,2,3), 2) ## c(2,3,3)
# }

Run the code above in your browser using DataLab