aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-02-08 15:25:19 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2019-02-08 15:25:19 +0100
commite5a077e28153f6494c99d6945b8b1bd239464609 (patch)
treedd5ea60934365215005361c7f22f0a3786128d1f /R
parentb935273d651301b271e0cb66bf36c2bbc1d15b32 (diff)
Make SSLRC and PEC drainage UK accept NA for Koc
Diffstat (limited to 'R')
-rw-r--r--R/SSLRC_mobility_classification.R18
1 files changed, 11 insertions, 7 deletions
diff --git a/R/SSLRC_mobility_classification.R b/R/SSLRC_mobility_classification.R
index deda5cf..2f8fb34 100644
--- a/R/SSLRC_mobility_classification.R
+++ b/R/SSLRC_mobility_classification.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Johannes Ranke
+# Copyright (C) 2015,2018 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package pfm
@@ -30,12 +30,16 @@
SSLRC_mobility_classification <- function(Koc)
{
if (!is.numeric(Koc) | length(Koc) != 1) stop("Please give a single number")
- result <- list("Non mobile", 0.01)
- if (Koc < 4000) result <- list("Slightly mobile", 0.02)
- if (Koc < 1000) result <- list("Slightly mobile", 0.5)
- if (Koc < 500) result <- list("Moderately mobile", 0.7)
- if (Koc < 75) result <- list("Mobile", 1.9)
- if (Koc < 15) result <- list("Very mobile", 1.9)
+ if (is.na(Koc)) {
+ result <- list(NA, NA)
+ } else {
+ result <- list("Non mobile", 0.01)
+ if (Koc < 4000) result <- list("Slightly mobile", 0.02)
+ if (Koc < 1000) result <- list("Slightly mobile", 0.5)
+ if (Koc < 500) result <- list("Moderately mobile", 0.7)
+ if (Koc < 75) result <- list("Mobile", 1.9)
+ if (Koc < 15) result <- list("Very mobile", 1.9)
+ }
names(result) <- c("Mobility classification",
"Percentage drained per mm of drain water")
return(result)

Contact - Imprint