summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <johannes.ranke@jrwb.de>2025-02-13 13:30:23 +0100
committerGitHub <noreply@github.com>2025-02-13 13:30:23 +0100
commitffb06bee1acfa1e5166b37971feaab895dd2b487 (patch)
tree52687f3994bd6255c31e9f47860bebc997ed69dc
parente7f7cfdeb40b836a2b4eb23ee93c57b4e6abb8f1 (diff)
parent5c30f11b1506bf49196f41f5fe03b2233f2930ee (diff)
Merge pull request #5 from Lutzeli/patch-1
Update PEC_sw_drainage_UK.R Closes #6
-rw-r--r--R/PEC_sw_drainage_UK.R7
1 files changed, 5 insertions, 2 deletions
diff --git a/R/PEC_sw_drainage_UK.R b/R/PEC_sw_drainage_UK.R
index b935dea..f094624 100644
--- a/R/PEC_sw_drainage_UK.R
+++ b/R/PEC_sw_drainage_UK.R
@@ -35,9 +35,12 @@ PEC_sw_drainage_UK <- function(rate, interception = 0, Koc,
if (!missing(latest_application)) {
lct <- Sys.getlocale("LC_TIME")
tmp <- Sys.setlocale("LC_TIME", "C")
- latest <- as.Date(paste(latest_application, "1999"), "%d %b %Y")
+ if (latest_application == "29 February") {
+ ref_year <- 2000
+ } else { ref_year <- 1999}
+ latest <- as.Date(paste(latest_application, ref_year), "%d %b %Y")
tmp <- Sys.setlocale("LC_TIME", lct)
- degradation_time <- as.numeric(difftime(as.Date("1999-10-01"), units = "days", latest))
+ degradation_time <- as.numeric(difftime(as.Date(paste0(ref_year,"-10-01")), units = "days", latest))
if (degradation_time > 0) {
if (!missing(soil_DT50)) {
k = log(2)/soil_DT50

Contact - Imprint