diff --git a/DESCRIPTION b/DESCRIPTION index 471922ee..9f368b5f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.7.1.9059 +Version: 1.7.1.9060 Date: 2021-12-05 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 8a3a6720..d7758f4f 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# `AMR` 1.7.1.9059 +# `AMR` 1.7.1.9060 ## Last updated: 5 December 2021 ### Breaking changes diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index d638ebe9..68224209 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -57,7 +57,7 @@ pm_left_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) { # adapted from https://github.com/nathaneastwood/poorman/blob/52eb6947e0b4430cd588976ed8820013eddf955f/R/where.R#L17-L32 where <- function(fn) { if (!is.function(fn)) { - stop(deparse_var(fn), " is not a valid predicate function.") + stop(pm_deparse_var(fn), " is not a valid predicate function.") } preds <- unlist(lapply( pm_select_env$.data, diff --git a/R/ab_property.R b/R/ab_property.R index d2e73433..5956a2e4 100644 --- a/R/ab_property.R +++ b/R/ab_property.R @@ -354,7 +354,7 @@ set_ab_names <- function(data, ..., property = "name", language = get_locale(), } if (is.data.frame(data)) { - if (length(list(...)) > 0) { + if (tryCatch(length(list(...)) > 0, error = function(e) TRUE)) { df <- pm_select(data, ...) } else { df <- data diff --git a/R/rsi.R b/R/rsi.R index b4bf9e05..a6043215 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -604,7 +604,11 @@ as.rsi.data.frame <- function(x, } i <- 0 - sel <- colnames(pm_select(x, ...)) + if (tryCatch(length(list(...)) > 0, error = function(e) TRUE)) { + sel <- colnames(pm_select(x, ...)) + } else { + sel <- colnames(x) + } if (!is.null(col_mo)) { sel <- sel[sel != col_mo] } diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index dcd96f44..d49a30d2 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/data-raw/reproduction_of_poorman.R b/data-raw/reproduction_of_poorman.R index 978bd795..ed32061e 100644 --- a/data-raw/reproduction_of_poorman.R +++ b/data-raw/reproduction_of_poorman.R @@ -78,4 +78,4 @@ writeLines(contents, "R/aa_helper_pm_functions.R") # after this, comment out: # pm_left_join() since we use a faster version -# pm_group_split() since we don't use it and it relies on R 3.5.0 for the use of ...length(), which is hard to support with C++ code +# pm_group_split() since we don't use it and it relies on R 3.5.0 for the use of ...length(), which is hard to support without C++ code diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index e780f5b9..8713ed11 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.7.1.9059 + 1.7.1.9060 diff --git a/docs/news/index.html b/docs/news/index.html index 181ea216..fb0cf8a1 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ AMR (for R) - 1.7.1.9059 + 1.7.1.9060 @@ -157,19 +157,19 @@
- +
-

Last updated: 5 December 2021

+

Last updated: 5 December 2021

-

Breaking changes

+

Breaking changes

  • Removed p_symbol() and all filter_*() functions (except for filter_first_isolate()), which were all deprecated in a previous package version
  • Removed the key_antibiotics() and key_antibiotics_equal() functions, which were deprecated and superseded by key_antimicrobials() and antimicrobials_equal()
  • Removed all previously implemented ggplot2::ggplot() generics for classes <mic>, <disk>, <rsi> and <resistance_predict> as they did not follow the ggplot2 logic. They were replaced with ggplot2::autoplot() generics.
-

New

+

New

  • Support for EUCAST Intrinsic Resistance and Unusual Phenotypes v3.3 (October 2021), effective in the eucast_rules() function. This is now the default guideline (all other guidelines are still available).

  • Function set_ab_names() to rename data set columns that resemble antimicrobial drugs. This allows for quickly renaming columns to official names, ATC codes, etc. Its second argument can be a tidyverse way of selecting:

    @@ -181,7 +181,7 @@
  • Support for Danish, and also added missing translations of all antimicrobial drugs in Italian, French and Portuguese

-

Changed

+

Changed

  • Updated the bacterial taxonomy to 5 October 2021 (according to LPSN), including all 11 new staphylococcal species named since 1 January last year
  • The antibiotics data set now contains all ATC codes that are available through the WHOCC website, regardless of drugs being present in more than one ATC group. This means that:
    • Some drugs now contain multiple ATC codes (e.g., metronidazole contains 5)
    • @@ -247,7 +247,7 @@ get_episode() and is_new_episode() can now cope with NAs
-

Other

+

Other

  • This package is now being maintained by two epidemiologists and a data scientist from two different non-profit healthcare organisations. All functions in this package are now all 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 from now on.