Running maximum
Running -value maximum and data frame with variable swapped for running maximum
runmax(y, n) dfrunmax(data, cons, ynm, n = 2)
y
: a vectorn
: an integer giving the number of observations to calculate running maxmimum over; defaults to 2data
: a data framecons
: a character string for the variable in data
that identifies consecutive observationsynm
: a character string for the variable in data
that is the observationsrunmax
returns a vector of the same dimension as y
dfrunmax
returns a data frame with observations swapped for -observation running maximum
runmax(runif(10), 5)
Useful links
Downloads (last 30 days):