diff --git a/DESCRIPTION b/DESCRIPTION index ad9c6049..042566db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.8.1 -Date: 2022-03-14 +Version: 1.8.0.9010 +Date: 2022-03-15 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index 18f36e42..02c8e64c 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# `AMR` 1.8.1 - +# `AMR` 1.8.0.9010 +## Last updated: 15 March 2022 All functions in this package are considered to be stable. Updates to the AMR interpretation rules (such as by EUCAST and CLSI), the microbial taxonomy, and the antibiotic dosages will all be updated every 6 to 12 months. @@ -14,6 +14,7 @@ All functions in this package are considered to be stable. Updates to the AMR in * More informative warning messages * Added 192 as valid MIC * Updated MIC printing in tibbles +* Increased speed for loading the package ### Other * Fix for unit testing on R 3.3 diff --git a/R/mic.R b/R/mic.R index adf73c8d..431ff46b 100755 --- a/R/mic.R +++ b/R/mic.R @@ -243,7 +243,7 @@ droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA, pillar_shaft.mic <- function(x, ...) { crude_numbers <- as.double(x) operators <- gsub("[^<=>]+", "", as.character(x)) - operators[operators != ""] <- font_silver(operators[operators != ""], collapse = NULL) + operators[!is.na(operators) & operators != ""] <- font_silver(operators[!is.na(operators) & operators != ""], collapse = NULL) out <- trimws(paste0(operators, trimws(format(crude_numbers)))) out[is.na(x)] <- font_na(NA) # maketrailing zeroes almost invisible diff --git a/R/mo.R b/R/mo.R index 62f291f3..dea905c9 100755 --- a/R/mo.R +++ b/R/mo.R @@ -1003,6 +1003,35 @@ exec_as.mo <- function(x, } } + # try splitting of characters in the middle and then find ID based on old names ---- + # only when text length is 6 or lower + # like esco = E. coli, klpn = K. pneumoniae, stau = S. aureus, staaur = S. aureus + if (nchar(g.x_backup_without_spp) <= 6) { + x_length <- nchar(g.x_backup_without_spp) + x_split <- paste0("^", + g.x_backup_without_spp %pm>% substr(1, x_length / 2), + ".* ", + g.x_backup_without_spp %pm>% substr((x_length / 2) + 1, x_length)) + found <- lookup(fullname_lower %like_case% x_split, + haystack = MO.old_lookup, + column = NULL) + if (!all(is.na(found))) { + # it's an old name, so return it + if (property == "ref") { + x[i] <- found["ref"] + } else { + x[i] <- lookup(fullname == found["fullname_new"], haystack = MO_lookup) + } + pkg_env$mo_renamed_last_run <- found["fullname"] + was_renamed(name_old = found["fullname"], + name_new = lookup(fullname == found["fullname_new"], "fullname", haystack = MO_lookup), + ref_old = found["ref"], + ref_new = lookup(fullname == found["fullname_new"], "ref", haystack = MO_lookup), + mo = lookup(fullname == found["fullname_new"], "mo", haystack = MO_lookup)) + return(x[i]) + } + } + # try fullname without start and without nchar limit of >= 6 ---- # like "K. pneu rhino" >> "Klebsiella pneumoniae (rhinoscleromatis)" = KLEPNERH found <- lookup(fullname_lower %like_case% e.x_withspaces_start_only, diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 94158329..4deae43b 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/404.html b/docs/404.html index 280769ef..3e4fea67 100644 --- a/docs/404.html +++ b/docs/404.html @@ -43,7 +43,7 @@ AMR (for R) - 1.8.1 + 1.8.0.9010 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index d3d3defe..358e2515 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1 + 1.8.0.9010 diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 92c297eb..bc954f2f 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.8.1 + 1.8.0.9010 @@ -190,7 +190,7 @@ diff --git a/docs/index.html b/docs/index.html index f9d0fde2..7ccf0243 100644 --- a/docs/index.html +++ b/docs/index.html @@ -47,7 +47,7 @@ AMR (for R) - 1.8.1 + 1.8.0.9010 diff --git a/docs/news/index.html b/docs/news/index.html index 1bccdd4c..fb0666b8 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1 + 1.8.0.9010 @@ -157,14 +157,16 @@
- + +
+

Last updated: 15 March 2022

All functions in this package are considered to be stable. Updates to the AMR interpretation rules (such as by EUCAST and CLSI), the microbial taxonomy, and the antibiotic dosages will all be updated every 6 to 12 months.

-

Changed

+

Changed

  • Fix for using as.rsi() on values containing capped values (such as >=), sometimes leading to NA

  • @@ -182,12 +184,14 @@ ignoring non-taxonomic text, such as:

  • More informative warning messages

  • Added 192 as valid MIC

  • Updated MIC printing in tibbles

  • +
  • Increased speed for loading the package

-

Other

+

Other

  • Fix for unit testing on R 3.3
  • Fix for size of some image elements, as requested by CRAN
+
@@ -628,7 +632,7 @@ function) to select/filter on e.g. linezolid and tedizolid

  • Support for custom MDRO guidelines, using the new custom_mdro_guideline() function, please see mdro() for additional info

  • -
  • ggplot() generics for classes +

  • ggplot() generics for classes <mic> and <disk>

  • Function mo_is_yeast(), which determines whether a @@ -697,7 +701,7 @@ printing)

  • translated if the system language is German, Dutch or Spanish (see translate)
  • Plotting is now possible with base R using plot() and -with ggplot2 using ggplot() on any vector of MIC and disk +with ggplot2 using ggplot() on any vector of MIC and disk diffusion values
  • Updated SNOMED codes to US Edition of SNOMED CT from 1 September @@ -740,7 +744,7 @@ per hour)
  • Argument ampc_cephalosporin_resistance in eucast_rules() now also applies to value “I” (not only “S”)
  • -
  • Functions print() and summary() on a +
  • Functions print() and summary() on a Principal Components Analysis object (pca()) now print additional group info if the original data was grouped using dplyr::group_by() @@ -1266,10 +1270,10 @@ 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:

    -