Skip to contents

Identify start and end of non-overlapping heat stress events

Usage

identify_heat_stress_events(dat, ..., heat_threshold = 18, n_hours = 24)

Arguments

dat

Data frame with at least three columns: TIMESTAMP (must be possible to convert to POSIXct), DEPTH, and VALUE. If column VARIABLE is included, it must have one unique entry. May also include columns with grouping variables passed to .... Other columns will be ignored.

...

Additional columns in dat to use as grouping variables. Results are automatically grouped by DEPTH.

heat_threshold

The threshold for heat stress. Default is heat_threshold = 18). Every observation above heat_threshold triggers an n-hour heat stress interval.

n_hours

Length of heat stress interval in hours (default is n_hours = 24).

Value

Returns a tibble with columns: ..., DEPTH, event_id, stress_start and stress_end.

Note: Events for a given depth do not overlap, but event_end and event_start may be consecutive timestamps.

Details

Every observation that exceeds the threshold is assigned a heat stress interval (TIMESTAMP of the observation + n_hours). Intervals may overlap with one or more other intervals.

Heat stress events are denoted by the beginning and end of overlapping intervals for each DEPTH and group in .... Heat stress events do not overlap, but they may end and start on consecutive TIMESTAMPs.