Skip to contents

These functions summarize heat accumulation from temperature vectors. degree_days_*() divides degree-hours by 24 and therefore assumes hourly input data. For daily data, use degree_hours_*() only if each row already represents the desired time step.

Usage

degree_hours_above(base, na.rm = TRUE)

degree_hours_below(base, na.rm = TRUE)

degree_days_above(base, na.rm = TRUE)

degree_days_below(base, na.rm = TRUE)

thermal_time_above(base, na.rm = TRUE)

thermal_time_between(lower, upper, na.rm = TRUE)

hours_in_temperature_range(lower, upper, inclusive = TRUE, na.rm = TRUE)

proportion_in_temperature_range(lower, upper, inclusive = TRUE, na.rm = TRUE)

Arguments

base

A single finite numeric base temperature.

na.rm

If TRUE, missing values are ignored. For proportion functions, the denominator is the number of non-missing observations.

lower, upper

Single finite numeric limits. lower must be less than or equal to upper.

inclusive

If TRUE, values equal to the boundary are included.

Value

A function that takes a numeric vector and returns one numeric value.

Examples

degree_hours_above(10)(c(8, 10, 12, 15))
#> [1] 7
thermal_time_between(18, 26)(c(16, 20, 30))
#> [1] 10