diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/SSLRC_mobility_classification.R | 18 |
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) |