count_max_event_days: Count the maximum number of days VALUE exceeds a threshold...

View source: R/count_max_event_days.R

count_max_event_daysR Documentation

Count the maximum number of days VALUE exceeds a threshold (above or below)

Description

Count the maximum number of days VALUE exceeds a threshold (above or below)

Usage

count_max_event_days(
  dat,
  threshold,
  ...,
  less_than = TRUE,
  summary_table = TRUE
)

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 BELOW threshold; if FALSE, will identify events when VALUE was ABOVE the threshold.

summary_table

Logical argument. If TRUE (the default), will return summary table with maximum event duration for each grouping variable. If FALSE, will return table with all exceedance events for each grouping variable.

Value

Returns summary table with maximum event duration for each grouping variable OR a table with all exceedance events for each grouping variable.


dempsey-CMAR/tgc documentation built on Oct. 20, 2023, 6:45 p.m.