diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 6499de07..3ae9834f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -79,7 +79,8 @@ jobs: env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} - + R_REPOSITORIES: "https://cran.rstudio.com" + steps: - uses: actions/checkout@v2 diff --git a/DESCRIPTION b/DESCRIPTION index 2505ed51..f4179071 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.7.0 -Date: 2021-05-26 +Version: 1.7.0.9000 +Date: 2021-05-30 Title: Antimicrobial Resistance Data Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 690d0526..1c2cc029 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,11 @@ -# `AMR` 1.7.0 +# `AMR` 1.7.0.9000 +## Last updated: 30 May 2021 +### Changed +* As requested by CRAN administrators: decreased package size by 3 MB in costs of a ~50 times slower loading time of the package (i.e., `library(AMR)`) +# `AMR` 1.7.0 + ### Breaking change * All antibiotic class selectors (such as `carbapenems()`, `aminoglycosides()`) can now be used for filtering as well, making all their accompanying `filter_*()` functions redundant (such as `filter_carbapenems()`, `filter_aminoglycosides()`). These functions are now deprecated and will be removed in a next release. ```r diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 17f2a05a..33dff254 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -178,9 +178,7 @@ search_type_in_df <- function(x, type, info = TRUE) { found <- sort(colnames(x)[vapply(FUN.VALUE = logical(1), x, is.mo)])[1] } else if ("mo" %in% colnames(x) & suppressWarnings( - all(x$mo %in% c(NA, - microorganisms$mo, - microorganisms.translation$mo_old)))) { + all(x$mo %in% c(NA, microorganisms$mo)))) { found <- "mo" } else if (any(colnames(x) %like% "^(mo|microorganism|organism|bacteria|ba[ck]terie)s?$")) { found <- sort(colnames(x)[colnames(x) %like% "^(mo|microorganism|organism|bacteria|ba[ck]terie)s?$"])[1] diff --git a/R/first_isolate.R b/R/first_isolate.R index c6e7f9c2..39668209 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -472,8 +472,8 @@ first_isolate <- function(x = NULL, as_note = FALSE) } if (type == "points") { - message_("Basing inclusion on all antimicrobial results, using a points threshold of " - , points_threshold, + message_("Basing inclusion on all antimicrobial results, using a points threshold of ", + points_threshold, add_fn = font_black, as_note = FALSE) } diff --git a/R/key_antimicrobials.R b/R/key_antimicrobials.R index 1af47321..c1c2b1d2 100755 --- a/R/key_antimicrobials.R +++ b/R/key_antimicrobials.R @@ -140,7 +140,7 @@ key_antimicrobials <- function(x = NULL, meet_criteria(antifungal, allow_class = "character", allow_NULL = TRUE) meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1) - # force regular [data.frame], not a tibble or data.table + # force regular data.frame, not a tibble or data.table x <- as.data.frame(x, stringsAsFactors = FALSE) cols <- get_column_abx(x, info = FALSE, only_rsi_columns = only_rsi_columns) @@ -237,7 +237,7 @@ all_antimicrobials <- function(x = NULL, meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0 meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1) - # force regular [data.frame], not a tibble or data.table + # force regular data.frame, not a tibble or data.table x <- as.data.frame(x, stringsAsFactors = FALSE) cols <- get_column_abx(x, only_rsi_columns = only_rsi_columns, info = FALSE, sort = FALSE) diff --git a/R/mo.R b/R/mo.R index b741e238..23859322 100755 --- a/R/mo.R +++ b/R/mo.R @@ -1817,8 +1817,7 @@ as.data.frame.mo <- function(x, ...) { y <- NextMethod() attributes(y) <- attributes(i) # must only contain valid MOs - return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), - as.character(microorganisms.translation$mo_old))) + return_after_integrity_check(y, "microorganism code", as.character(microorganisms$mo)) } #' @method [[<- mo #' @export @@ -1827,8 +1826,7 @@ as.data.frame.mo <- function(x, ...) { y <- NextMethod() attributes(y) <- attributes(i) # must only contain valid MOs - return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), - as.character(microorganisms.translation$mo_old))) + return_after_integrity_check(y, "microorganism code", as.character(microorganisms$mo)) } #' @method c mo #' @export @@ -1837,8 +1835,7 @@ c.mo <- function(...) { x <- list(...)[[1L]] y <- NextMethod() attributes(y) <- attributes(x) - return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), - as.character(microorganisms.translation$mo_old))) + return_after_integrity_check(y, "microorganism code", as.character(microorganisms$mo)) } #' @method unique mo @@ -2053,23 +2050,39 @@ parse_and_convert <- function(x) { } replace_old_mo_codes <- function(x, property) { - if (any(toupper(x) %in% microorganisms.translation$mo_old, na.rm = TRUE)) { + ind <- x %like% "[A-Z_]" & !x %in% MO_lookup$mo + if (any(ind)) { # get the ones that match - matched <- match(toupper(x), microorganisms.translation$mo_old) - # and their new codes - mo_new <- microorganisms.translation$mo_new[matched] + affected <- x[ind] + affected_unique <- unique(affected) + all_direct_matches <- TRUE + # find their new codes, once per code + solved_unique <- unlist(lapply(strsplit(affected_unique, ""), + function(m) { + m <- m[3:length(m)] + m <- m[m != "_"] + m <- tolower(paste0(m, ".*", collapse = "")) + out <- MO_lookup$mo[MO_lookup$fullname_lower %like_case% m] + if (length(out) > 1) { + all_direct_matches <<- FALSE + } + out[1L] + }), use.names = FALSE) + solved <- solved_unique[match(affected, affected_unique)] # assign on places where a match was found - x[which(!is.na(matched))] <- mo_new[which(!is.na(matched))] - n_matched <- length(matched[!is.na(matched)]) + x[ind] <- solved + n_matched <- length(affected[!is.na(affected)]) + n_unique <- length(affected_unique[!is.na(affected_unique)]) if (property != "mo") { message_(font_blue(paste0("The input contained ", n_matched, " old MO code", ifelse(n_matched == 1, "", "s"), - " (from a previous AMR package version). Please update your MO codes with `as.mo()`."))) + " (", n_unique, " unique, from a previous AMR package version). Please update your MO codes with `as.mo()` to increase speed."))) } else { message_(font_blue(paste0(n_matched, " old MO code", ifelse(n_matched == 1, "", "s"), - " (from a previous AMR package version) ", + " (", n_unique, " unique, from a previous AMR package version) ", ifelse(n_matched == 1, "was", "were"), - " updated to ", ifelse(n_matched == 1, "a ", ""), + ifelse(all_direct_matches, " updated ", font_bold(" guessed ")), + "to ", ifelse(n_matched == 1, "a ", ""), "currently used MO code", ifelse(n_matched == 1, "", "s"), "."))) } } diff --git a/R/mo_source.R b/R/mo_source.R index afc17655..5f5f83ef 100644 --- a/R/mo_source.R +++ b/R/mo_source.R @@ -275,9 +275,9 @@ check_validity_mo_source <- function(x, refer_to_name = "`reference_df`", stop_o return(FALSE) } } - if (!all(x$mo %in% c("", microorganisms$mo, microorganisms.translation$mo_old), na.rm = TRUE)) { + if (!all(x$mo %in% c("", microorganisms$mo), na.rm = TRUE)) { if (stop_on_error == TRUE) { - invalid <- x[which(!x$mo %in% c("", microorganisms$mo, microorganisms.translation$mo_old)), , drop = FALSE] + invalid <- x[which(!x$mo %in% c("", microorganisms$mo)), , drop = FALSE] if (nrow(invalid) > 1) { plural <- "s" } else { diff --git a/R/sysdata.rda b/R/sysdata.rda index 083b8534..51680594 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/R/zzz.R b/R/zzz.R index 1d4ad5b0..bcb2d57d 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -72,4 +72,76 @@ if (utf8_supported && !is_latex) { invisible(get_mo_source()) } }, silent = TRUE) + + + # reference data - they have additional columns compared to `antibiotics` and `microorganisms` to improve speed + assign(x = "AB_lookup", value = create_AB_lookup(), envir = asNamespace("AMR")) + assign(x = "MO_lookup", value = create_MO_lookup(), envir = asNamespace("AMR")) + assign(x = "MO.old_lookup", value = create_MO.old_lookup(), envir = asNamespace("AMR")) + # for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector + assign(x = "INTRINSIC_R", value = create_intr_resistance(), envir = asNamespace("AMR")) +} + + +# Helper functions -------------------------------------------------------- + +create_AB_lookup <- function() { + AB_lookup <- AMR::antibiotics + AB_lookup$generalised_name <- generalise_antibiotic_name(AB_lookup$name) + AB_lookup$generalised_synonyms <- lapply(AB_lookup$synonyms, generalise_antibiotic_name) + AB_lookup$generalised_abbreviations <- lapply(AB_lookup$abbreviations, generalise_antibiotic_name) + AB_lookup$generalised_loinc <- lapply(AB_lookup$loinc, generalise_antibiotic_name) + AB_lookup$generalised_all <- unname(lapply(as.list(as.data.frame(t(AB_lookup[, + c("ab", "atc", "cid", "name", + colnames(AB_lookup)[colnames(AB_lookup) %like% "generalised"]), + drop = FALSE]), + stringsAsFactors = FALSE)), + function(x) { + x <- generalise_antibiotic_name(unname(unlist(x))) + x[x != ""] + })) + AB_lookup +} + +create_MO_lookup <- function() { + MO_lookup <- AMR::microorganisms + + MO_lookup$kingdom_index <- NA_real_ + MO_lookup[which(MO_lookup$kingdom == "Bacteria" | MO_lookup$mo == "UNKNOWN"), "kingdom_index"] <- 1 + MO_lookup[which(MO_lookup$kingdom == "Fungi"), "kingdom_index"] <- 2 + MO_lookup[which(MO_lookup$kingdom == "Protozoa"), "kingdom_index"] <- 3 + MO_lookup[which(MO_lookup$kingdom == "Archaea"), "kingdom_index"] <- 4 + # all the rest + MO_lookup[which(is.na(MO_lookup$kingdom_index)), "kingdom_index"] <- 5 + + # use this paste instead of `fullname` to work with Viridans Group Streptococci, etc. + MO_lookup$fullname_lower <- tolower(trimws(paste(MO_lookup$genus, + MO_lookup$species, + MO_lookup$subspecies))) + ind <- MO_lookup$genus == "" | grepl("^[(]unknown ", MO_lookup$fullname, perl = TRUE) + MO_lookup[ind, "fullname_lower"] <- tolower(MO_lookup[ind, "fullname"]) + MO_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", MO_lookup$fullname_lower, perl = TRUE)) + + # add a column with only "e coli" like combinations + MO_lookup$g_species <- gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO_lookup$fullname_lower, perl = TRUE) + + # so arrange data on prevalence first, then kingdom, then full name + MO_lookup[order(MO_lookup$prevalence, MO_lookup$kingdom_index, MO_lookup$fullname_lower), ] +} + +create_MO.old_lookup <- function() { + MO.old_lookup <- AMR::microorganisms.old + MO.old_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", tolower(trimws(MO.old_lookup$fullname)))) + + # add a column with only "e coli"-like combinations + MO.old_lookup$g_species <- trimws(gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO.old_lookup$fullname_lower)) + + # so arrange data on prevalence first, then full name + MO.old_lookup[order(MO.old_lookup$prevalence, MO.old_lookup$fullname_lower), ] +} + +create_intr_resistance <- function() { + # for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector + paste(AMR::microorganisms[match(AMR::intrinsic_resistant$microorganism, AMR::microorganisms$fullname), "mo", drop = TRUE], + AMR::antibiotics[match(AMR::intrinsic_resistant$antibiotic, AMR::antibiotics$name), "ab", drop = TRUE]) } diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 870548b1..b2a8b975 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/data-raw/_internals.R b/data-raw/_internals.R index 4aff8f05..c7fbf430 100644 --- a/data-raw/_internals.R +++ b/data-raw/_internals.R @@ -31,109 +31,6 @@ devtools::load_all(quiet = TRUE) old_globalenv <- ls(envir = globalenv()) -# Helper functions -------------------------------------------------------- - -create_species_cons_cops <- function(type = c("CoNS", "CoPS")) { - # Determination of which staphylococcal species are CoNS/CoPS according to: - # - Becker et al. 2014, PMID 25278577 - # - Becker et al. 2019, PMID 30872103 - # - Becker et al. 2020, PMID 32056452 - # this function returns class - MO_staph <- AMR::microorganisms - MO_staph <- MO_staph[which(MO_staph$genus == "Staphylococcus"), , drop = FALSE] - if (type == "CoNS") { - MO_staph[which(MO_staph$species %in% c("coagulase-negative", "argensis", "arlettae", - "auricularis", "borealis", "caeli", "capitis", "caprae", - "carnosus", "casei", "chromogenes", "cohnii", "condimenti", - "croceilyticus", - "debuckii", "devriesei", "edaphicus", "epidermidis", - "equorum", "felis", "fleurettii", "gallinarum", - "haemolyticus", "hominis", "jettensis", "kloosii", - "lentus", "lugdunensis", "massiliensis", "microti", - "muscae", "nepalensis", "pasteuri", "petrasii", - "pettenkoferi", "piscifermentans", "pragensis", "pseudoxylosus", - "pulvereri", "rostri", "saccharolyticus", "saprophyticus", - "sciuri", "simulans", "stepanovicii", "succinus", - "ureilyticus", - "vitulinus", "vitulus", "warneri", "xylosus") - | (MO_staph$species == "schleiferi" & MO_staph$subspecies %in% c("schleiferi", ""))), - "mo", drop = TRUE] - } else if (type == "CoPS") { - MO_staph[which(MO_staph$species %in% c("coagulase-positive", "coagulans", - "agnetis", "argenteus", - "cornubiensis", - "delphini", "lutrae", - "hyicus", "intermedius", - "pseudintermedius", "pseudointermedius", - "schweitzeri", "simiae") - | (MO_staph$species == "schleiferi" & MO_staph$subspecies == "coagulans")), - "mo", drop = TRUE] - } -} - -create_AB_lookup <- function() { - AB_lookup <- AMR::antibiotics - AB_lookup$generalised_name <- generalise_antibiotic_name(AB_lookup$name) - AB_lookup$generalised_synonyms <- lapply(AB_lookup$synonyms, generalise_antibiotic_name) - AB_lookup$generalised_abbreviations <- lapply(AB_lookup$abbreviations, generalise_antibiotic_name) - AB_lookup$generalised_loinc <- lapply(AB_lookup$loinc, generalise_antibiotic_name) - AB_lookup$generalised_all <- unname(lapply(as.list(as.data.frame(t(AB_lookup[, - c("ab", "atc", "cid", "name", - colnames(AB_lookup)[colnames(AB_lookup) %like% "generalised"]), - drop = FALSE]), - stringsAsFactors = FALSE)), - function(x) { - x <- generalise_antibiotic_name(unname(unlist(x))) - x[x != ""] - })) - AB_lookup -} - -create_MO_lookup <- function() { - MO_lookup <- AMR::microorganisms - - MO_lookup$kingdom_index <- NA_real_ - MO_lookup[which(MO_lookup$kingdom == "Bacteria" | MO_lookup$mo == "UNKNOWN"), "kingdom_index"] <- 1 - MO_lookup[which(MO_lookup$kingdom == "Fungi"), "kingdom_index"] <- 2 - MO_lookup[which(MO_lookup$kingdom == "Protozoa"), "kingdom_index"] <- 3 - MO_lookup[which(MO_lookup$kingdom == "Archaea"), "kingdom_index"] <- 4 - # all the rest - MO_lookup[which(is.na(MO_lookup$kingdom_index)), "kingdom_index"] <- 5 - - # use this paste instead of `fullname` to work with Viridans Group Streptococci, etc. - MO_lookup$fullname_lower <- tolower(trimws(paste(MO_lookup$genus, - MO_lookup$species, - MO_lookup$subspecies))) - ind <- MO_lookup$genus == "" | grepl("^[(]unknown ", MO_lookup$fullname) - MO_lookup[ind, "fullname_lower"] <- tolower(MO_lookup[ind, "fullname"]) - MO_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", MO_lookup$fullname_lower, perl = TRUE)) - - # add a column with only "e coli" like combinations - MO_lookup$g_species <- gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO_lookup$fullname_lower, perl = TRUE) - - # so arrange data on prevalence first, then kingdom, then full name - MO_lookup[order(MO_lookup$prevalence, MO_lookup$kingdom_index, MO_lookup$fullname_lower), ] -} - -create_MO.old_lookup <- function() { - MO.old_lookup <- AMR::microorganisms.old - MO.old_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", tolower(trimws(MO.old_lookup$fullname)))) - - # add a column with only "e coli"-like combinations - MO.old_lookup$g_species <- trimws(gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO.old_lookup$fullname_lower)) - - # so arrange data on prevalence first, then full name - MO.old_lookup[order(MO.old_lookup$prevalence, MO.old_lookup$fullname_lower), ] -} - -create_intr_resistance <- function() { - # for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector - paste(AMR::microorganisms[match(AMR::intrinsic_resistant$microorganism, AMR::microorganisms$fullname), "mo", drop = TRUE], - AMR::antibiotics[match(AMR::intrinsic_resistant$antibiotic, AMR::antibiotics$name), "ab", drop = TRUE]) -} - - - # Save internal data to R/sysdata.rda ------------------------------------- # See 'data-raw/eucast_rules.tsv' for the EUCAST reference file @@ -170,24 +67,50 @@ translations_file <- utils::read.delim(file = "data-raw/translations.tsv", allowEscapes = TRUE, # else "\\1" will be imported as "\\\\1" quote = "") -# Old microorganism codes -microorganisms.translation <- readRDS("data-raw/microorganisms.translation.rds") - -# for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector -INTRINSIC_R <- create_intr_resistance() - # for checking input in `language` argument in e.g. mo_*() and ab_*() functions LANGUAGES_SUPPORTED <- sort(c("en", colnames(translations_file)[nchar(colnames(translations_file)) == 2])) # vectors of CoNS and CoPS, improves speed in as.mo() +create_species_cons_cops <- function(type = c("CoNS", "CoPS")) { + # Determination of which staphylococcal species are CoNS/CoPS according to: + # - Becker et al. 2014, PMID 25278577 + # - Becker et al. 2019, PMID 30872103 + # - Becker et al. 2020, PMID 32056452 + # this function returns class + MO_staph <- AMR::microorganisms + MO_staph <- MO_staph[which(MO_staph$genus == "Staphylococcus"), , drop = FALSE] + if (type == "CoNS") { + MO_staph[which(MO_staph$species %in% c("coagulase-negative", "argensis", "arlettae", + "auricularis", "borealis", "caeli", "capitis", "caprae", + "carnosus", "casei", "chromogenes", "cohnii", "condimenti", + "croceilyticus", + "debuckii", "devriesei", "edaphicus", "epidermidis", + "equorum", "felis", "fleurettii", "gallinarum", + "haemolyticus", "hominis", "jettensis", "kloosii", + "lentus", "lugdunensis", "massiliensis", "microti", + "muscae", "nepalensis", "pasteuri", "petrasii", + "pettenkoferi", "piscifermentans", "pragensis", "pseudoxylosus", + "pulvereri", "rostri", "saccharolyticus", "saprophyticus", + "sciuri", "simulans", "stepanovicii", "succinus", + "ureilyticus", + "vitulinus", "vitulus", "warneri", "xylosus") + | (MO_staph$species == "schleiferi" & MO_staph$subspecies %in% c("schleiferi", ""))), + "mo", drop = TRUE] + } else if (type == "CoPS") { + MO_staph[which(MO_staph$species %in% c("coagulase-positive", "coagulans", + "agnetis", "argenteus", + "cornubiensis", + "delphini", "lutrae", + "hyicus", "intermedius", + "pseudintermedius", "pseudointermedius", + "schweitzeri", "simiae") + | (MO_staph$species == "schleiferi" & MO_staph$subspecies == "coagulans")), + "mo", drop = TRUE] + } +} MO_CONS <- create_species_cons_cops("CoNS") MO_COPS <- create_species_cons_cops("CoPS") -# reference data - they have additional columns compared to `antibiotics` and `microorganisms` to improve speed -AB_lookup <- create_AB_lookup() -MO_lookup <- create_MO_lookup() -MO.old_lookup <- create_MO.old_lookup() - # antibiotic groups # (these will also be used for eucast_rules() and understanding data-raw/eucast_rules.tsv) globalenv_before_ab <- c(ls(envir = globalenv()), "globalenv_before_ab") @@ -220,14 +143,10 @@ DEFINED_AB_GROUPS <- DEFINED_AB_GROUPS[!DEFINED_AB_GROUPS %in% globalenv_before_ # Export to package as internal data ---- usethis::use_data(eucast_rules_file, translations_file, - microorganisms.translation, - INTRINSIC_R, LANGUAGES_SUPPORTED, MO_CONS, MO_COPS, AB_lookup, - MO_lookup, - MO.old_lookup, AMINOGLYCOSIDES, AMINOPENICILLINS, CARBAPENEMS, diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index 73eec453..75975cf9 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -872,12 +872,12 @@ View(old_new) # set new MO codes as names to existing data sets rsi_translation$mo <- mo_name(rsi_translation$mo, language = NULL) microorganisms.codes$mo <- mo_name(microorganisms.codes$mo, language = NULL) -microorganisms.translation <- AMR:::microorganisms.translation %>% - bind_rows(tibble(mo_old = AMR:::microorganisms.translation$mo_new, mo_new = mo_old)) %>% - filter(!mo_old %in% MOs$mo) %>% - mutate(mo_new = mo_name(mo_new, language = NULL)) %>% - bind_rows(old_new %>% select(mo_old, mo_new)) %>% - distinct(mo_old, .keep_all = TRUE) +# microorganisms.translation <- AMR:::microorganisms.translation %>% +# bind_rows(tibble(mo_old = AMR:::microorganisms.translation$mo_new, mo_new = mo_old)) %>% +# filter(!mo_old %in% MOs$mo) %>% +# mutate(mo_new = mo_name(mo_new, language = NULL)) %>% +# bind_rows(old_new %>% select(mo_old, mo_new)) %>% +# distinct(mo_old, .keep_all = TRUE) # arrange the data sets to save MOs <- MOs %>% arrange(fullname) @@ -911,23 +911,23 @@ devtools::load_all(".") rsi_translation$mo <- as.mo(rsi_translation$mo) microorganisms.codes$mo <- as.mo(microorganisms.codes$mo) class(microorganisms.codes$mo) <- c("mo", "character") -microorganisms.translation <- microorganisms.translation %>% - # (to do: add last package version to column pkg_version) - left_join(microorganisms.old[, c("fullname", "fullname_new")], # microorganisms.old is now new and loaded - by = c("mo_new" = "fullname")) %>% - mutate(name = ifelse(!is.na(fullname_new), fullname_new, mo_new)) %>% - left_join(microorganisms[, c("fullname", "mo")], # as is microorganisms - by = c("name" = "fullname")) %>% - select(mo_old, mo_new = mo) %>% - filter(!is.na(mo_old), !is.na(mo_new)) -class(microorganisms.translation$mo_old) <- "character" # no class since those aren't valid MO codes -class(microorganisms.translation$mo_new) <- c("mo", "character") +# microorganisms.translation <- microorganisms.translation %>% +# # (to do: add last package version to column pkg_version) +# left_join(microorganisms.old[, c("fullname", "fullname_new")], # microorganisms.old is now new and loaded +# by = c("mo_new" = "fullname")) %>% +# mutate(name = ifelse(!is.na(fullname_new), fullname_new, mo_new)) %>% +# left_join(microorganisms[, c("fullname", "mo")], # as is microorganisms +# by = c("name" = "fullname")) %>% +# select(mo_old, mo_new = mo) %>% +# filter(!is.na(mo_old), !is.na(mo_new)) +# class(microorganisms.translation$mo_old) <- "character" # no class since those aren't valid MO codes +# class(microorganisms.translation$mo_new) <- c("mo", "character") # save those to the package usethis::use_data(rsi_translation, overwrite = TRUE, version = 2) usethis::use_data(microorganisms.codes, overwrite = TRUE, version = 2) -saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2) +# saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2) # to save microorganisms.translation internally to the package -source("data-raw/_internals.R") +# source("data-raw/_internals.R") # load new data sets again devtools::load_all(".") @@ -935,7 +935,7 @@ devtools::load_all(".") # and check: these codes should not be missing (will otherwise throw a unit test error): AMR::microorganisms.codes %>% filter(!mo %in% MOs$mo) AMR::rsi_translation %>% filter(!mo %in% MOs$mo) -AMR:::microorganisms.translation %>% filter(!mo_new %in% MOs$mo) +# AMR:::microorganisms.translation %>% filter(!mo_new %in% MOs$mo) # update the example_isolates data set example_isolates$mo <- as.mo(example_isolates$mo) diff --git a/data-raw/reproduction_of_microorganisms_update.R b/data-raw/reproduction_of_microorganisms_update.R index b4dcfb2e..1b07742c 100644 --- a/data-raw/reproduction_of_microorganisms_update.R +++ b/data-raw/reproduction_of_microorganisms_update.R @@ -380,37 +380,37 @@ MOs.old <- microorganisms.old %>% # Keep old codes for translation ------------------------------------------ # add removed microbial IDs to the internal translation table so old package versions keep working -MOs.translation <- microorganisms %>% - filter(!mo %in% MOs$mo) %>% - select(mo, fullname) %>% - left_join(new_synonyms) %>% - left_join(MOs %>% transmute(fullname_new = fullname, mo2 = as.character(mo))) %>% - select(mo_old = mo, mo_new = mo2) %>% - distinct() -MOs.translation <- AMR:::microorganisms.translation %>% - left_join(MOs.translation %>% select(mo_new_update = mo_new, mo_new = mo_old)) %>% - mutate(mo_new = as.character(ifelse(!is.na(mo_new_update), mo_new_update, mo_new))) %>% - select(-mo_new_update) %>% - bind_rows( - # old IDs used in microorganisms.codes must put in here as well - microorganisms.codes %>% - filter(!mo %in% MOs$mo) %>% - transmute(mo_old = mo, fullname = mo_name(mo)) %>% - left_join(MOs.old %>% - select(fullname, fullname_new)) %>% - left_join(MOs %>% - select(mo_new = mo, fullname_new = fullname)) %>% - transmute(mo_old = as.character(mo_old), mo_new)) %>% - arrange(mo_old) %>% - filter(mo_old != mo_new, - !mo_old %in% MOs$mo) %>% - left_join(., ., - by = c("mo_new" = "mo_old"), - suffix = c("", ".2")) %>% - mutate(mo_new = ifelse(!is.na(mo_new.2), mo_new.2, mo_new)) %>% - distinct(mo_old, mo_new) %>% - # clean up - df_remove_nonASCII() +# MOs.translation <- microorganisms %>% +# filter(!mo %in% MOs$mo) %>% +# select(mo, fullname) %>% +# left_join(new_synonyms) %>% +# left_join(MOs %>% transmute(fullname_new = fullname, mo2 = as.character(mo))) %>% +# select(mo_old = mo, mo_new = mo2) %>% +# distinct() +# MOs.translation <- AMR:::microorganisms.translation %>% +# left_join(MOs.translation %>% select(mo_new_update = mo_new, mo_new = mo_old)) %>% +# mutate(mo_new = as.character(ifelse(!is.na(mo_new_update), mo_new_update, mo_new))) %>% +# select(-mo_new_update) %>% +# bind_rows( +# # old IDs used in microorganisms.codes must put in here as well +# microorganisms.codes %>% +# filter(!mo %in% MOs$mo) %>% +# transmute(mo_old = mo, fullname = mo_name(mo)) %>% +# left_join(MOs.old %>% +# select(fullname, fullname_new)) %>% +# left_join(MOs %>% +# select(mo_new = mo, fullname_new = fullname)) %>% +# transmute(mo_old = as.character(mo_old), mo_new)) %>% +# arrange(mo_old) %>% +# filter(mo_old != mo_new, +# !mo_old %in% MOs$mo) %>% +# left_join(., ., +# by = c("mo_new" = "mo_old"), +# suffix = c("", ".2")) %>% +# mutate(mo_new = ifelse(!is.na(mo_new.2), mo_new.2, mo_new)) %>% +# distinct(mo_old, mo_new) %>% +# # clean up +# df_remove_nonASCII() message("microorganisms new: ", sum(!MOs$fullname %in% c(microorganisms$fullname, MOs.old$fullname))) message("microorganisms renamed: ", sum(!MOs.old$fullname %in% microorganisms.old$fullname)) @@ -424,12 +424,12 @@ class(MOs.translation$mo_new) <- c("mo", "character") microorganisms <- MOs microorganisms.old <- MOs.old -microorganisms.translation <- MOs.translation +# microorganisms.translation <- MOs.translation # on the server, do: usethis::use_data(microorganisms, overwrite = TRUE, version = 2, compress = "xz") usethis::use_data(microorganisms.old, overwrite = TRUE, version = 2) -saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2) +# saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2) rm(microorganisms) rm(microorganisms.old) rm(microorganisms.translation) diff --git a/docs/404.html b/docs/404.html index c35ff6d9..1664da0c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index d9619e59..28ebce3a 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 26dcbb03..5e6b655f 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 @@ -192,7 +192,7 @@ diff --git a/docs/authors.html b/docs/authors.html index aa6ef6b2..39e0e17e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/index.html b/docs/index.html index 7010f2ea..4bbb274b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/news/index.html b/docs/news/index.html index 80311c50..455003e5 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 @@ -236,6 +236,22 @@ Source: NEWS.md +
+

+ Unreleased AMR 1.7.0.9000

+
+

+Last updated: 30 May 2021 +

+
+

+Changed

+
    +
  • As requested by CRAN administrators: decreased package size by 3 MB in costs of a ~50 times slower loading time of the package (i.e., library(AMR))
  • +
+
+
+

Unreleased AMR 1.7.0

@@ -288,9 +304,9 @@
-
+

-Changed

+Changed
-
+

-Changed

+Changed
-
+

-Changed

+Changed
  • New argument ampc_cephalosporin_resistance in eucast_rules() to correct for AmpC de-repressed cephalosporin-resistant mutants

  • @@ -619,9 +635,9 @@
  • Support for skimming classes <rsi>, <mic>, <disk> and <mo> with the skimr package

-
+

-Changed

+Changed
  • Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.

  • @@ -724,9 +740,9 @@
  • Added argument conserve_capped_values to as.rsi() for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of as.rsi() has not changed, so you need to specifically do as.rsi(..., conserve_capped_values = TRUE).

-
+

-Changed

+Changed
  • Big speed improvement for using any function on microorganism codes from earlier package versions (prior to AMR v1.2.0), such as as.mo(), mo_name(), first_isolate(), eucast_rules(), mdro(), etc.

    @@ -791,7 +807,7 @@

    Making this package independent of especially the tidyverse (e.g. packages dplyr and tidyr) tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.

    Negative effects of this change are:

      -
    • Function freq() that was borrowed from the cleaner package was removed. Use cleaner::freq(), or run library("cleaner") before you use freq().
    • +
    • Function freq() that was borrowed from the cleaner package was removed. Use cleaner::freq(), or run library("cleaner") before you use freq().
    • Printing values of class mo or rsi in a tibble will no longer be in colour and printing rsi in a tibble will show the class <ord>, not <rsi> anymore. This is purely a visual effect.
    • All functions from the mo_* family (like mo_name() and mo_gramstain()) are noticeably slower when running on hundreds of thousands of rows.
    • For developers: classes mo and ab now both also inherit class character, to support any data transformation. This change invalidates code that checks for class length == 1.
    • @@ -799,9 +815,9 @@
-
+

-Changed

+Changed
  • Taxonomy:
      @@ -853,9 +869,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • Plotting biplots for principal component analysis using the new ggplot_pca() function
-
+

-Changed

+Changed
  • Improvements for the algorithm used by as.mo() (and consequently all mo_* functions, that use as.mo() internally):
      @@ -886,9 +902,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/

      2020-02-23 AMR 1.0.1

      -
      +

      -Changed

      +Changed
      • Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline

      • @@ -1123,7 +1139,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ #> invalid microorganism code, NA generated

      This is important, because a value like "testvalue" could never be understood by e.g. mo_name(), although the class would suggest a valid microbial code.

      -
    • Function freq() has moved to a new package, clean (CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq() function still works, since it is re-exported from the clean package (which will be installed automatically upon updating this AMR package).

    • +
    • Function freq() has moved to a new package, clean (CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq() function still works, since it is re-exported from the clean package (which will be installed automatically upon updating this AMR package).

    • Renamed data set septic_patients to example_isolates

@@ -1194,9 +1210,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
-
+

-Changed

+Changed
  • Many algorithm improvements for as.mo() (of which some led to additions to the microorganisms data set). Many thanks to all contributors that helped improving the algorithms.
      @@ -1306,9 +1322,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • Function mo_synonyms() to get all previously accepted taxonomic names of a microorganism

-
+

-Changed

+Changed
  • Column names of output count_df() and portion_df() are now lowercase
  • Fixed bug in translation of microorganism names
  • @@ -1354,9 +1370,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (mdr_tb()) and added a new vignette about MDR. Read this tutorial here on our website.
-
+

-Changed

+Changed
  • Fixed a critical bug in first_isolate() where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.
  • Fixed a bug in eucast_rules() where antibiotics from WHONET software would not be recognised
  • @@ -1390,7 +1406,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • The age() function gained a new argument exact to determine ages with decimals
  • Removed deprecated functions guess_mo(), guess_atc(), EUCAST_rules(), interpretive_reading(), rsi()
  • -
  • Frequency tables (freq()): +
  • Frequency tables (freq()):
    • speed improvement for microbial IDs

    • fixed factor level names for R Markdown

    • @@ -1400,12 +1416,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
       
       septic_patients %>% 
      -  freq(age) %>% 
      +  freq(age) %>% 
         boxplot()
       # grouped boxplots:
       septic_patients %>% 
         group_by(hospital_id) %>% 
      -  freq(age) %>%
      +  freq(age) %>%
         boxplot()
    @@ -1415,7 +1431,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Added ceftazidim intrinsic resistance to Streptococci
  • Changed default settings for age_groups(), to let groups of fives and tens end with 100+ instead of 120+
  • -
  • Fix for freq() for when all values are NA +
  • Fix for freq() for when all values are NA
  • Fix for first_isolate() for when dates are missing
  • Improved speed of guess_ab_col() @@ -1440,9 +1456,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/

    2019-03-29 AMR 0.6.1

    -
    +

    -Changed

    +Changed
    • Fixed a critical bug when using eucast_rules() with verbose = TRUE
    • @@ -1559,9 +1575,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the G-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR.

    -
    +

    -Changed

    +Changed
    • Function eucast_rules():
        @@ -1654,7 +1670,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • -
    • Frequency tables (freq() function): +
    • Frequency tables (freq() function):
      • Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:

        @@ -1664,15 +1680,15 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ # OLD WAY septic_patients %>% mutate(genus = mo_genus(mo)) %>% - freq(genus) + freq(genus) # NEW WAY septic_patients %>% - freq(mo_genus(mo)) + freq(mo_genus(mo)) # Even supports grouping variables: septic_patients %>% group_by(gender) %>% - freq(mo_genus(mo))
    + freq(mo_genus(mo))
  • Header info is now available as a list, with the header function

  • The argument header is now set to TRUE at default, even for markdown

  • @@ -1717,9 +1733,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Functions mo_authors and mo_year to get specific values about the scientific reference of a taxonomic entry
-
+

-Changed

+Changed
  • Functions MDRO, BRMO, MRGN and EUCAST_exceptional_phenotypes were renamed to mdro, brmo, mrgn and eucast_exceptional_phenotypes

  • EUCAST_rules was renamed to eucast_rules, the old function still exists as a deprecated function

  • @@ -1754,7 +1770,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Using portion_* functions now throws a warning when total available isolate is below argument minimum

  • Functions as.mo, as.rsi, as.mic, as.atc and freq will not set package name as attribute anymore

  • -

    Frequency tables - freq():

    +

    Frequency tables - freq():

    • Support for grouping variables, test with:

      @@ -1762,14 +1778,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ septic_patients %>% group_by(hospital_id) %>% - freq(gender)
+ freq(gender)
  • Support for (un)selecting columns:

     
     septic_patients %>% 
    -  freq(hospital_id) %>% 
    +  freq(hospital_id) %>% 
       select(-count, -cum_count) # only get item, percent, cum_percent
  • Check for hms::is.hms

  • @@ -1787,7 +1803,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Removed diacritics from all authors (columns microorganisms$ref and microorganisms.old$ref) to comply with CRAN policy to only allow ASCII characters

  • Fix for mo_property not working properly

  • Fix for eucast_rules where some Streptococci would become ceftazidime R in EUCAST rule 4.5

  • -
  • Support for named vectors of class mo, useful for top_freq()

  • +
  • Support for named vectors of class mo, useful for top_freq()

  • ggplot_rsi and scale_y_percent have breaks argument

  • AI improvements for as.mo:

    @@ -1907,9 +1923,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Renamed septic_patients$sex to septic_patients$gender

  • -
    +

    -Changed

    +Changed
    • Added three antimicrobial agents to the antibiotics data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)

    • @@ -1954,13 +1970,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
       
       my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2))
      -freq(my_matrix)
      +freq(my_matrix)

    For lists, subsetting is possible:

     
     my_list = list(age = septic_patients$age, gender = septic_patients$gender)
    -my_list %>% freq(age)
    -my_list %>% freq(gender)
    +my_list %>% freq(age) +my_list %>% freq(gender)
    @@ -2033,13 +2049,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • A vignette to explain its usage
    • Support for rsi (antimicrobial resistance) to use as input
    • -
    • Support for table to use as input: freq(table(x, y)) +
    • Support for table to use as input: freq(table(x, y))
    • Support for existing functions hist and plot to use a frequency table as input: hist(freq(df$age))
    • Support for as.vector, as.data.frame, as_tibble and format
    • -
    • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn) +
    • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn)
    • Function top_freq function to return the top/below n items as vector
    • Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
    • @@ -2048,9 +2064,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    -
    +

    -Changed

    +Changed
    • Improvements for forecasting with resistance_predict and added more examples
    • More antibiotics added as arguments for EUCAST rules
    • @@ -2133,9 +2149,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • New print format for tibbles and data.tables
    -
    +

    -Changed

    +Changed
    • Fixed rsi class for vectors that contain only invalid antimicrobial interpretations
    • Renamed dataset ablist to antibiotics diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 0bc295f2..9faffc34 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: 2021-05-26T12:00Z +last_built: 2021-05-30T20:01Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index f9b16361..db5d030d 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 32c155e3..594f875f 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/age.html b/docs/reference/age.html index 6033a307..28e000d6 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html index be6c10c4..ccb865bb 100644 --- a/docs/reference/antibiotic_class_selectors.html +++ b/docs/reference/antibiotic_class_selectors.html @@ -83,7 +83,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 3644dd6a..96e2b60f 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index 0faca9b4..9f8944d3 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 43b244e3..11c7a8b7 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index ef8cf6e5..77b775a8 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/availability.html b/docs/reference/availability.html index 0dd1d73c..86a3cb3c 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000
    diff --git a/docs/reference/count.html b/docs/reference/count.html index de7396e1..7425fc39 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html index a1e53c22..cb4ab3da 100644 --- a/docs/reference/ggplot_pca.html +++ b/docs/reference/ggplot_pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index c463d168..85ed24b0 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/index.html b/docs/reference/index.html index e20fac71..b92204b4 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/intrinsic_resistant.html b/docs/reference/intrinsic_resistant.html index 516d393d..827b9700 100644 --- a/docs/reference/intrinsic_resistant.html +++ b/docs/reference/intrinsic_resistant.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/italicise_taxonomy.html b/docs/reference/italicise_taxonomy.html index 6b10f081..4c45de27 100644 --- a/docs/reference/italicise_taxonomy.html +++ b/docs/reference/italicise_taxonomy.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index 1ad36cb3..a8b12480 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/pca.html b/docs/reference/pca.html index d8b3989c..6d1a0184 100644 --- a/docs/reference/pca.html +++ b/docs/reference/pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/plot.html b/docs/reference/plot.html index 19bd91d3..4f2e1e33 100644 --- a/docs/reference/plot.html +++ b/docs/reference/plot.html @@ -82,7 +82,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index a4864168..829de574 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/docs/survey.html b/docs/survey.html index 648dc342..3e1708ed 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.7.0 + 1.7.0.9000 diff --git a/inst/tinytest/test-data.R b/inst/tinytest/test-data.R index 9577ad38..38397ce6 100644 --- a/inst/tinytest/test-data.R +++ b/inst/tinytest/test-data.R @@ -34,8 +34,6 @@ expect_identical(class(antibiotics$ab), c("ab", "character")) # check cross table reference expect_true(all(microorganisms.codes$mo %in% microorganisms$mo)) expect_true(all(example_isolates$mo %in% microorganisms$mo)) -expect_true(all(AMR:::microorganisms.translation$mo_new %in% microorganisms$mo)) -expect_false(any(AMR:::microorganisms.translation$mo_old %in% microorganisms$mo)) expect_true(all(rsi_translation$mo %in% microorganisms$mo)) expect_true(all(rsi_translation$ab %in% antibiotics$ab)) expect_true(all(intrinsic_resistant$microorganism %in% microorganisms$fullname)) # also important for mo_is_intrinsic_resistant()