
Maximum number of consecutive entries with respect to threshold
maxRunningValue.RdCompute the maximum number of consecutive entries above, equal or lower
than a given threshold.
Details
The function computes the maximum number of consecutive elements of a list of number
above, equal or lower than a given threshold.
Its behaviour is regulated by the value of the logic argument.
Examples
if (FALSE) { # \dontrun{
# `modeldata` is a `data.table` with columns: datetime, no2, x and y.
# Let's look for the maximum number of consecutive days with no2 > 200, cell by cell.
modeldata[, heavyPoll := maxRunningValue(no2, threshold = 200), by = list(x, y)]
} # }