From ddae8085e1bb0bbe0b5a22254d2990cf492d98b0 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Mon, 19 Oct 2020 20:44:45 +0200 Subject: [PATCH] (v1.4.0.9002) bugfix --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/ab.R | 2 +- R/mo.R | 4 +-- R/mo_property.R | 66 +++++++++++++++++++-------------------- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 8 ++--- docs/pkgdown.yml | 2 +- docs/reference/index.html | 2 +- docs/survey.html | 2 +- 14 files changed, 50 insertions(+), 50 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d96ec232..f7e62c67 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.4.0.9001 +Version: 1.4.0.9002 Date: 2020-10-19 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 0e089b0e..778c41e1 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.4.0.9001 +# AMR 1.4.0.9002 ## Last updated: 19 October 2020 ### New diff --git a/R/ab.R b/R/ab.R index 1b61fb49..9f556b6a 100755 --- a/R/ab.R +++ b/R/ab.R @@ -82,7 +82,7 @@ #' ab_name("J01FA01") # "Erythromycin" #' ab_name("eryt") # "Erythromycin" as.ab <- function(x, flag_multiple_results = TRUE, info = TRUE, ...) { - meet_criteria(x, allow_class = c("character", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_class = c("character", "numeric", "integer", "factor"), allow_NA = TRUE) meet_criteria(flag_multiple_results, allow_class = "logical", has_length = 1) meet_criteria(info, allow_class = "logical", has_length = 1) diff --git a/R/mo.R b/R/mo.R index 97f064e3..48b5dfa8 100755 --- a/R/mo.R +++ b/R/mo.R @@ -158,7 +158,7 @@ as.mo <- function(x, ignore_pattern = getOption("AMR_ignore_pattern"), language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(Becker, allow_class = c("logical", "character"), has_length = 1) meet_criteria(Lancefield, allow_class = c("logical", "character"), has_length = 1) meet_criteria(allow_uncertain, allow_class = c("logical", "numeric", "integer"), has_length = 1) @@ -275,7 +275,7 @@ exec_as.mo <- function(x, actual_uncertainty = 1, actual_input = NULL, language = get_locale()) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(Becker, allow_class = c("logical", "character"), has_length = 1) meet_criteria(Lancefield, allow_class = c("logical", "character"), has_length = 1) meet_criteria(allow_uncertain, allow_class = c("logical", "numeric", "integer"), has_length = 1) diff --git a/R/mo_property.R b/R/mo_property.R index b12fbcc5..e2794d70 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -146,7 +146,7 @@ #' mo_info("E. coli") #' } mo_name <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "fullname", language = language, ...), language = language, only_unknown = FALSE) @@ -159,7 +159,7 @@ mo_fullname <- mo_name #' @rdname mo_property #' @export mo_shortname <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x.mo <- as.mo(x, language = language, ...) @@ -192,7 +192,7 @@ mo_shortname <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_subspecies <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "subspecies", language = language, ...), language = language, only_unknown = TRUE) @@ -201,7 +201,7 @@ mo_subspecies <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_species <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "species", language = language, ...), language = language, only_unknown = TRUE) @@ -210,7 +210,7 @@ mo_species <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_genus <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "genus", language = language, ...), language = language, only_unknown = TRUE) @@ -219,7 +219,7 @@ mo_genus <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_family <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "family", language = language, ...), language = language, only_unknown = TRUE) @@ -228,7 +228,7 @@ mo_family <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_order <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "order", language = language, ...), language = language, only_unknown = TRUE) @@ -237,7 +237,7 @@ mo_order <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_class <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "class", language = language, ...), language = language, only_unknown = TRUE) @@ -246,7 +246,7 @@ mo_class <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_phylum <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "phylum", language = language, ...), language = language, only_unknown = TRUE) @@ -255,7 +255,7 @@ mo_phylum <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_kingdom <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "kingdom", language = language, ...), language = language, only_unknown = TRUE) @@ -268,7 +268,7 @@ mo_domain <- mo_kingdom #' @rdname mo_property #' @export mo_type <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) translate_AMR(mo_validate(x = x, property = "kingdom", language = language, ...), language = language, only_unknown = FALSE) @@ -277,7 +277,7 @@ mo_type <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_gramstain <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x.mo <- as.mo(x, language = language, ...) @@ -311,7 +311,7 @@ mo_gramstain <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export is_gram_negative <- function(x, ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) grams <- mo_gramstain(x, language = NULL, ...) "Gram-negative" == grams & !is.na(grams) } @@ -319,7 +319,7 @@ is_gram_negative <- function(x, ...) { #' @rdname mo_property #' @export is_gram_positive <- function(x, ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) grams <- mo_gramstain(x, language = NULL, ...) "Gram-positive" == grams & !is.na(grams) } @@ -327,7 +327,7 @@ is_gram_positive <- function(x, ...) { #' @rdname mo_property #' @export mo_snomed <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) mo_validate(x = x, property = "snomed", language = language, ...) @@ -336,7 +336,7 @@ mo_snomed <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_ref <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) mo_validate(x = x, property = "ref", language = language, ...) @@ -345,7 +345,7 @@ mo_ref <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_authors <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x <- mo_validate(x = x, property = "ref", language = language, ...) @@ -357,7 +357,7 @@ mo_authors <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_year <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x <- mo_validate(x = x, property = "ref", language = language, ...) @@ -369,7 +369,7 @@ mo_year <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_rank <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) mo_validate(x = x, property = "rank", language = language, ...) @@ -378,20 +378,20 @@ mo_rank <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_taxonomy <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x <- as.mo(x, language = language, ...) metadata <- get_mo_failures_uncertainties_renamed() result <- list(kingdom = mo_kingdom(x, language = language), - phylum = mo_phylum(x, language = language), - class = mo_class(x, language = language), - order = mo_order(x, language = language), - family = mo_family(x, language = language), - genus = mo_genus(x, language = language), - species = mo_species(x, language = language), - subspecies = mo_subspecies(x, language = language)) + phylum = mo_phylum(x, language = language), + class = mo_class(x, language = language), + order = mo_order(x, language = language), + family = mo_family(x, language = language), + genus = mo_genus(x, language = language), + species = mo_species(x, language = language), + subspecies = mo_subspecies(x, language = language)) load_mo_failures_uncertainties_renamed(metadata) result @@ -400,7 +400,7 @@ mo_taxonomy <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_synonyms <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x <- as.mo(x, language = language, ...) @@ -429,7 +429,7 @@ mo_synonyms <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_info <- function(x, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) x <- as.mo(x, language = language, ...) @@ -455,7 +455,7 @@ mo_info <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_url <- function(x, open = FALSE, language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(open, allow_class = "logical", has_length = 1) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) @@ -464,7 +464,7 @@ mo_url <- function(x, open = FALSE, language = get_locale(), ...) { metadata <- get_mo_failures_uncertainties_renamed() df <- data.frame(mo, stringsAsFactors = FALSE) %pm>% - pm_left_join(pm_select(microorganisms, mo, source, species_id), by = "mo") + pm_left_join(pm_select(microorganisms, mo, source, species_id), by = "mo") df$url <- ifelse(df$source == "CoL", paste0(catalogue_of_life$url_CoL, "details/species/id/", df$species_id, "/"), ifelse(df$source == "DSMZ", @@ -488,10 +488,10 @@ mo_url <- function(x, open = FALSE, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_property <- function(x, property = "fullname", language = get_locale(), ...) { - meet_criteria(x, allow_class = c("character", "data.frame", "list", "numeric", "integer"), allow_NA = TRUE) + meet_criteria(x, allow_NA = TRUE) meet_criteria(property, allow_class = "character", has_length = 1, is_in = colnames(microorganisms)) meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE) - + translate_AMR(mo_validate(x = x, property = property, language = language, ...), language = language, only_unknown = TRUE) } diff --git a/docs/404.html b/docs/404.html index 46071773..da5fb27a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 74a69438..98a1cba3 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 diff --git a/docs/articles/index.html b/docs/articles/index.html index 6985cace..6fac2270 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 diff --git a/docs/authors.html b/docs/authors.html index 4cc5ba93..4ee02551 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 diff --git a/docs/index.html b/docs/index.html index cf92ad40..7f6efa7c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 diff --git a/docs/news/index.html b/docs/news/index.html index 811e112d..0ef4cb7f 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002 @@ -236,9 +236,9 @@ Source: NEWS.md -
-

-AMR 1.4.0.9001 Unreleased +
+

+AMR 1.4.0.9002 Unreleased

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3c3a246a..29151880 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2020-10-19T15:08Z +last_built: 2020-10-19T18:44Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/index.html b/docs/reference/index.html index 9b99eaad..444a94ce 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002

diff --git a/docs/survey.html b/docs/survey.html index 0d95ba7d..243c2082 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9001 + 1.4.0.9002