Count the maximum number of days VALUE exceeds a threshold (above or below)
count_max_event_days.RdCount the maximum number of days VALUE exceeds a threshold (above or below)
Arguments
- dat
Dataframe that must include columns VALUE (numeric) and TIMESTAMP (POSIXct), and a column for each grouping variable in
....- threshold
Value to cross to trigger exceedance (exclusive)
- ...
Names of columns that should be used as grouping variables (not quoted), e.g.
DEPTH, YEAR.- less_than
Logical argument. If
TRUE(the default), function will identify events when VALUE was BELOWthreshold; ifFALSE, will identify events when VALUE was ABOVE thethreshold.- summary_table
Logical argument. If
TRUE(the default), will return summary table with maximum event duration for each grouping variable. IfFALSE, will return table with all exceedance events for each grouping variable.