From 0edd9ff5dcdc65de4f8438403fdee747335a6d5a Mon Sep 17 00:00:00 2001 From: PaulMelloy Date: Tue, 30 Jul 2024 21:00:28 +1000 Subject: [PATCH] As per discussion in issue #22 --- R/latent_period.R | 4 +++- tests/testthat/test-thermal_functions.R | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/R/latent_period.R b/R/latent_period.R index 5514974..a3f6fe6 100644 --- a/R/latent_period.R +++ b/R/latent_period.R @@ -1,7 +1,9 @@ #' Calculate Cercospora latent period #' #' @details Calculates the latent period for *Cercospora beticola* infections on -#' sugar beet +#' sugar beet. Note the published formula in \insertCite{wolf_factors_2005} +#' contains an error in the exponent. e(0.35 x (Tm - 10)) should be +#' e(-0.35 x (Tm - 10)). See issue #22 on github for additional information. #' #' @param Tm numeric, Average temperature in degrees Celsius for a hour of the day #' @param ref character, method for calculating latent period. Default is `"wolf"` diff --git a/tests/testthat/test-thermal_functions.R b/tests/testthat/test-thermal_functions.R index 9ae2461..f677d8c 100644 --- a/tests/testthat/test-thermal_functions.R +++ b/tests/testthat/test-thermal_functions.R @@ -58,3 +58,8 @@ test_that("moisture_index(method =2) examples work", { expect_equal(moisture_index(55,rh_thresh = 50, method = 2), 0.00540259, tolerance = 0.00001) }) +# see issue #22 +plot(latent_period(9:35), x = 9:35, + xlab = "Temperature C", + ylab = "days", + pch = 16)