diff options
| author | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-08 15:25:19 +0100 | 
|---|---|---|
| committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-08 15:25:19 +0100 | 
| commit | e5a077e28153f6494c99d6945b8b1bd239464609 (patch) | |
| tree | dd5ea60934365215005361c7f22f0a3786128d1f | |
| parent | b935273d651301b271e0cb66bf36c2bbc1d15b32 (diff) | |
Make SSLRC and PEC drainage UK accept NA for Koc
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | DESCRIPTION | 2 | ||||
| -rw-r--r-- | R/SSLRC_mobility_classification.R | 18 | 
3 files changed, 18 insertions, 8 deletions
@@ -1,3 +1,9 @@ +commit b935273d651301b271e0cb66bf36c2bbc1d15b32 +Author: Johannes Ranke <jranke@uni-bremen.de> +Date:   2019-01-31 01:40:24 +0100 + +    Separate out PELMO utilities into rPELMO +  commit 1611dd58df6b2b2e6ad01af6573664da8ce8b6b9  Author: Johannes Ranke <jranke@uni-bremen.de>  Date:   2019-01-30 23:58:55 +0100 diff --git a/DESCRIPTION b/DESCRIPTION index 02dd2e0..994bc4e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pfm  Type: Package  Title: Utilities for Pesticide Fate Modelling  Version: 0.5.3 -Date: 2019-01-31 +Date: 2019-02-08  Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de",                    role = c("aut", "cre", "cph"),                    comment = c(ORCID = "0000-0003-4371-6538")) 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)  | 
