Calculate thermal time for a crop
thermal_time(..., crop)The thermal time.
# Example weather data
mint <- c(0, 10)
maxt <- c(30, 40)
date <- as.Date(c("2024-01-01", "2024-01-02"))
# Use default lupin parameters
thermal_time(
mint,
maxt,
date = date,
latitude = -27,
crop = "lupin"
)
#> [1] 16.64386 24.88400
# Modify the global lupin thermal time response
crop("lupin")$set(
"phenology.thermal_time" =
list(
x = c(0, 25, 35),
y = c(0, 25, 0)
)
)
thermal_time(
mint,
maxt,
date = date,
latitude = -27,
crop = "lupin"
)
#> [1] 16.64386 24.88400
# Override thermal time parameters for a single call
thermal_time(
mint,
maxt,
date = date,
latitude = -27,
crop = "lupin",
x_temp = c(0, 25, 35),
y_temp = c(0, 25, 0)
)
#> [1] 16.64386 24.88400