aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_PEC_sw_drift.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-09-27 23:00:48 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2016-09-27 23:00:48 +0200
commit12a31f4c130c551f82232d9ef7dfb608bd52c53f (patch)
tree2525ab1ea4102a6edddbd0c2f03f4a851bf2f9c5 /tests/testthat/test_PEC_sw_drift.R
parent0d958ab6f84b569b5437f231c56004890c4ae23b (diff)
Reorganise repository using standard package layout
Diffstat (limited to 'tests/testthat/test_PEC_sw_drift.R')
-rw-r--r--tests/testthat/test_PEC_sw_drift.R15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/testthat/test_PEC_sw_drift.R b/tests/testthat/test_PEC_sw_drift.R
new file mode 100644
index 0000000..d09d578
--- /dev/null
+++ b/tests/testthat/test_PEC_sw_drift.R
@@ -0,0 +1,15 @@
+library(pfm)
+context("Simple PEC surface water calculations with drift entry")
+
+test_that("PEC_sw_drift gives the same results as the CRD PEC calculator", {
+ # One application of 30 g/ha to field crops calculated with UK PEC calculator published by CRD
+ expect_equal(round(PEC_sw_drift(30), 3),
+ c('1 m' = 0.277, '5 m' = 0.057, '10 m' = 0.029, '20 m' = 0.015))
+
+ # 7 applications of 30 g/ha to field crops calculated with UK PEC calculator, initial PEC
+ expect_equal(round(PEC_sw_drift(30, 7), 3),
+ c('1 m' = 0.161, '5 m' = 0.033, '10 m' = 0.017, '20 m' = 0.008))
+
+ # 4 applications of 30 g/ha to late fruit crops calculated with UK PEC calculator published by CRD (uses different drift values from SANCO aquatic guidance)
+ #expect_equal(round(PEC_sw_drift(30, 4, crop = "Obstbau spät", distances = c(3, 20, 50)), 3), c('3 m' = 1.101, '20 m' = 0.080, '50 m' = 0.013))
+})

Contact - Imprint