summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/PEC_sw_drainage_UK.R4
-rw-r--r--R/PEC_sw_drift.R2
2 files changed, 5 insertions, 1 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) {
diff --git a/R/PEC_sw_drift.R b/R/PEC_sw_drift.R
index 7028101..5c7fff4 100644
--- a/R/PEC_sw_drift.R
+++ b/R/PEC_sw_drift.R
@@ -21,7 +21,7 @@
#' either in the original form or integrated over the width of the water body, depending
#' on the 'formula' argument.
#' @param crop_group_JKI When using the 'JKI' drift data, one of the German names
-#' as used in [drift_parameters_focus]. Will only be used if drift_data is 'JKI'.
+#' as used in [drift_data_JKI]. Will only be used if drift_data is 'JKI'.
#' @param water_depth Depth of the water body in cm
#' @param PEC_units Requested units for the calculated PEC. Only µg/L currently supported
#' @param water_width Width of the water body in cm

Contact - Imprint