degree_days = function(air_temperature,
direction = "above",
base_temperature) {
if (direction == "above") {
unlist(lapply(base_temperature, function(x) {sum(air_temperature[air_temperature > x] - x, na.rm = T)}))
} else {
unlist(lapply(base_temperature, function(x) {sum(air_temperature[air_temperature < x] - x, na.rm = T)}))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.