diff options
author | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-02-13 13:46:24 +0100 |
---|---|---|
committer | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-02-13 13:46:24 +0100 |
commit | b24f0e8968499af833fff14834f3ed395e5e9f9b (patch) | |
tree | 705bbc36c5d954a6260db3086413578326ff74dd /R/PEC_sw_drainage_UK.R | |
parent | ffb06bee1acfa1e5166b37971feaab895dd2b487 (diff) |
Diffstat (limited to 'R/PEC_sw_drainage_UK.R')
-rw-r--r-- | R/PEC_sw_drainage_UK.R | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/R/PEC_sw_drainage_UK.R b/R/PEC_sw_drainage_UK.R index f094624..4b3111e 100644 --- a/R/PEC_sw_drainage_UK.R +++ b/R/PEC_sw_drainage_UK.R @@ -25,6 +25,9 @@ #' @author Johannes Ranke #' @examples #' PEC_sw_drainage_UK(150, Koc = 100) +#' PEC_sw_drainage_UK(60, interception = 0.5, Koc = 550, +#' latest_application = "01 July", soil_DT50 = 200) + PEC_sw_drainage_UK <- function(rate, interception = 0, Koc, latest_application = NULL, soil_DT50 = NULL, model = NULL, model_parms = NULL) @@ -39,6 +42,7 @@ PEC_sw_drainage_UK <- function(rate, interception = 0, Koc, ref_year <- 2000 } else { ref_year <- 1999} latest <- as.Date(paste(latest_application, ref_year), "%d %b %Y") + if (is.na(latest)) stop("Please specify the latest application in the format '%d %b', e.g. '01 July'") tmp <- Sys.setlocale("LC_TIME", lct) degradation_time <- as.numeric(difftime(as.Date(paste0(ref_year,"-10-01")), units = "days", latest)) if (degradation_time > 0) { |