Identify start and end of growing seasons for each year
identify_growing_seasons.Rd
Identify start and end of growing seasons for each year
Usage
identify_growing_seasons(
dat,
...,
full_season = TRUE,
trend_threshold = 4,
superchill_threshold = -0.7,
max_season = 540
)
Arguments
- dat
Data frame with at least three columns:
TIMESTAMP
(must be possible to convert to POSIXct),DEPTH
, andVALUE
. If columnVARIABLE
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 byDEPTH
.- full_season
Logical argument. The default,
full_season = TRUE
will returnNA
forSTART_SEASON
andEND_SEASON
that occur outside of the date range of the data series. For example, if the data series starts when temperature is already abovetrend_threshold
,START_SEASON = NA
; if the season length is determined bymax_season
, which results in a date after the last observation,END_SEASON = NA
. Iffull_season = FALSE
, theSTART_SEASON
andEND_SEASON
dates default to the first and last timestamp in...
andDEPTH
.- trend_threshold
The threshold for "trending up". Default is
trend_threshold = 4
. The last observation abovetrend_threshold
that does not return belowtrend_threshold
triggers the beginning of the growing season for eachDEPTH
and group in...
.- superchill_threshold
The threshold for "superchill". Default is
superchill_threshold = -0.7
. The first observation belowsuperchill_threshold
triggers the end of the growing season for each group inDEPTH
and...
.- max_season
The length of the growing season in months for groups that have no temperature observations below
superchill_threshold
. Default ismax_season = 540
days (~18 months). Note: units are days because adding 18 months to August 30 or August 31 results inNA
(because February 30 and February 31 are not real dates).
Value
Returns a tibble with the START_SEASON
, END_SEASON
,
SEASON_DAYS
(length of season in days), and SEASON_MONTHS
(season length in months; assumes 1 month = 30 days) for each group in
DEPTH
and group in ...
.
Details
The growing season starts when the temperature crosses
trend_threshold
and does not return below trend_threshold
(e.g., 4-degrees trending up) and ends 1 minute before the first
observation of superchill_threshold
.
The function looks for START_SEASON
in January to August to avoid
temperature drops caused by hurricanes (typically in September and October)
and Winter cooling (November, December).
The function looks for END_SEASON
in January to May of the next year
(spring superchill).
If the time series begins when the temperature is above
trend_threshold
, START_SEASON
is assigned the minimum
TIMESTAMP
for the group in filter_growing_season()
.
If the time series does not go below superchill_threshold
, the
growing season is assumed to be max_season
months long.
END_SEASON
is assigned the timestamp START_SEASON
+
days(max_season)
.
Growing seasons may overlap if max_season
is used to determine
END_SEASON
.