These functions summarize runs of consecutive observations that satisfy a
condition. Missing values break sequences when na.rm = TRUE.
Usage
max_consecutive_above(threshold, na.rm = TRUE)
max_consecutive_at_or_above(threshold, na.rm = TRUE)
max_consecutive_below(threshold, na.rm = TRUE)
max_consecutive_at_or_below(threshold, na.rm = TRUE)
max_consecutive_between(lower, upper, inclusive = TRUE, na.rm = TRUE)
spell_count_above(threshold, na.rm = TRUE)
spell_count_at_or_above(threshold, na.rm = TRUE)
spell_count_below(threshold, na.rm = TRUE)
spell_count_between(lower, upper, inclusive = TRUE, na.rm = TRUE)
mean_spell_duration_above(threshold, na.rm = TRUE)
max_spell_duration_above(threshold, na.rm = TRUE)Arguments
- threshold
A single finite numeric threshold.
- na.rm
If
TRUE, missing values are ignored. For proportion functions, the denominator is the number of non-missing observations.- lower, upper
Single finite numeric limits.
lowermust be less than or equal toupper.- inclusive
If
TRUE, values equal to the boundary are included.
