degree_days: Caclulate degree days

Description Usage Arguments Details References Examples

View source: R/degree_days.R

Description

degree_days returns a data frame with calculated daily degree days within a specified thresholds.

Usage

1
degree_days(data, thresholds)

Arguments

data

data in wide format with minimum temperature labeled as tmin and maximum temperature labeled as tmax

thresholds

threshold of temperature intervals to calculate degree days

Details

To generate degree days the data must be in wide format with minimum temperature column labeled as tmin and maximum temperature labeled as tmax.

Degree days are calcuated from the following cases:

(1) Minimum temperature >= threshold

dday = (tmax - tmin/2) - threshold

(2) Minimum temperature < Threshold < Maximum Temperature

dday = ( W integral_theta^pi/2 sin(t)dt - integral_theta^pi/2 (threshold - tmin)dt ) / pi

W = (tmax - tmin)/2

theta = sin^-1 [ ( tmax - tmin )/W ]

(3) Otherwise, degree days = 0

References

Snyder, Richard L. "Hand calculating degree days." Agricultural and forest meteorology 35, no. 1-4 (1985): 353-358.

Woodill, A. John "United States Temperature Exposure 1900-2013." (2016) http://johnwoodill.blogspot.com/2016/06/us-degree-days-heat-map-interesting.html

Examples

1
2
data(napa)
degree_days(napa, thresholds = c(0:35))

johnwoodill/nonlineartempr documentation built on Dec. 7, 2019, 9:11 a.m.