Skip to contents

Identify when VALUE begins trending up

Usage

identify_trending_up(dat, ..., trend_threshold = 4)

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.

trend_threshold

The threshold for "trending up". Default is trend_threshold = 4. The last observation above trend_threshold that does not return below trend_threshold triggers the beginning of the growing season for each DEPTH and group in ....

Value

Returns a tibble. START_TREND is the TIMESTAMP of the final time VALUE exceeds trend_threshold and does not return below trend_threshold (for each DEPTH and group in ...).

This TIMESTAMP is passed to identify_growing_seasons() to denote the start of the growing season.

START_TREND is assigned NA for groups for which VALUE

did not cross trend_threshold.

Details

Identifies TIMESTAMP when VALUE exceeds a threshold and does not return below the threshold, for each group in DEPTH and ....

If VALUE never crosses the threshold because temperature is always > trend_threshold, the date will be returned as NA.

VALUE = trend_threshold is considered over the threshold.

Examples

data("string_data")

string_data <- string_data[which(string_data$VARIABLE == "Temperature"), ]
trend_up <- identify_trending_up(string_data, trend_threshold = 4)