aboutsummaryrefslogtreecommitdiff
path: root/inst/data_generation/PEC_sw_exposit.R
diff options
context:
space:
mode:
authorRanke Johannes <johannes.ranke@agroscope.admin.ch>2024-01-31 13:16:17 +0100
committerRanke Johannes <johannes.ranke@agroscope.admin.ch>2024-01-31 13:27:50 +0100
commitaed160d7f0eaf5865e2bd9bf6c4b1c9d7b13d911 (patch)
tree7ca136834857c12449f50a1e086a589cc9b79e2e /inst/data_generation/PEC_sw_exposit.R
parent64f629efbe666bae56f48a309adf33d1eb09c358 (diff)
Reorganise data generation
- Use inst/data_generation for R code generating data as in some of my other packages - data/*.RData files were checked using https://github.com/jranke/dotfiles/blob/main/bin/rda_diff contents were not changed - Remove ChangeLog, the history is in the git logs - Update docs and some links contained therein - use \doi{} markup - Move logs to log directory
Diffstat (limited to 'inst/data_generation/PEC_sw_exposit.R')
-rw-r--r--inst/data_generation/PEC_sw_exposit.R34
1 files changed, 34 insertions, 0 deletions
diff --git a/inst/data_generation/PEC_sw_exposit.R b/inst/data_generation/PEC_sw_exposit.R
new file mode 100644
index 0000000..f7d9737
--- /dev/null
+++ b/inst/data_generation/PEC_sw_exposit.R
@@ -0,0 +1,34 @@
+library(here)
+
+# Runoff percentages
+Koc_breaks <- c(0, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, Inf)
+tmp <- paste(Koc_breaks[1:11], Koc_breaks[2:12], sep = "-")
+Koc_classes <- c(tmp[1], paste0(">", tmp[2:11]), ">50000")
+perc_runoff_exposit <- data.frame(
+ Koc_lower_bound = Koc_breaks[1:12],
+ dissolved = c(0.11, 0.151, 0.197, 0.248, 0.224, 0.184, 0.133, 0.084, 0.037, 0.031, 0.014, 0.001),
+ bound = c(0, 0, 0, 0.001, 0.004, 0.020, 0.042, 0.091, 0.159, 0.192, 0.291, 0.451))
+rownames(perc_runoff_exposit) <- Koc_classes
+
+# Runoff reduction percentages
+perc_runoff_reduction_exposit <- list(
+ "3.02" = data.frame(
+ dissolved = c(0, 40, 60, 80),
+ bound = c(0, 40, 85, 95),
+ row.names = c("No buffer", paste(c(5, 10, 20), "m"))),
+ "3.01a" = data.frame(
+ dissolved = c(0, 25, 40, 45, 60, 80),
+ bound = c(0, 30, 40, 55, 85, 95),
+ row.names = c("No buffer", paste(c(3, 5, 6, 10, 20), "m"))),
+ "3.01a2" = data.frame(
+ dissolved = c(0, 25),
+ bound = c(0, 25),
+ row.names = c("No buffer", paste(c(3), "m"))),
+ "2.0" = data.frame(
+ dissolved = c(0, 97.5),
+ bound = c(0, 97.5),
+ row.names = c("No buffer", "20 m"))
+)
+
+save(perc_runoff_exposit, perc_runoff_reduction_exposit,
+ file = here("data/perc_runoff.RData"))

Contact - Imprint