diff --git a/DESCRIPTION b/DESCRIPTION index 607de7d3..4e139437 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.7.1.9064 +Version: 1.7.1.9065 Date: 2021-12-11 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 16074718..04e69995 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# `AMR` 1.7.1.9064 +# `AMR` 1.7.1.9065 ## Last updated: 11 December 2021 ### Breaking changes diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 94c48244..4f0d271e 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -912,17 +912,18 @@ unique_call_id <- function(entire_session = FALSE, match_fn = NULL) { # combination of environment ID (such as "0x7fed4ee8c848") # and relevant system call (where 'match_fn' is being called in) calls <- sys.calls() - int <- which(vapply(FUN.VALUE = logical(1), - calls, - function(call, fun = match_fn) { - call_clean <- gsub("[^a-zA-Z0-9_().-]", "", as.character(call), perl = TRUE) - any(call_clean %like% paste0(fun, "\\("), na.rm = TRUE) - }))[1L] - if (is.na(int)) { - int <- 1 + if (!identical(Sys.getenv("R_RUN_TINYTEST"), "true") && + !any(as.character(calls[[1]]) %like_case% "run_test_dir|run_test_file|test_all|tinytest|test_package|testthat")) { + for (i in seq_len(length(calls))) { + call_clean <- gsub("[^a-zA-Z0-9_().-]", "", as.character(calls[[i]]), perl = TRUE) + if (any(call_clean %like% paste0(match_fn, "\\("), na.rm = TRUE)) { + return(c(envir = gsub("", "\\1", utils::capture.output(sys.frames()[[1]]), perl = TRUE), + call = paste0(deparse(calls[[i]]), collapse = ""))) + } + } } - c(envir = gsub("", "\\1", utils::capture.output(sys.frames()[[1]]), perl = TRUE), - call = paste0(deparse(calls[[int]]), collapse = "")) + c(envir = paste0(sample(c(c(0:9), letters[1:6]), size = 32, replace = TRUE), collapse = ""), + call = paste0(sample(c(c(0:9), letters[1:6]), size = 32, replace = TRUE), collapse = "")) } #' @noRd diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 2e44f661..f889fe46 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 31caecb3..85335aa3 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.7.1.9064 + 1.7.1.9065 diff --git a/docs/news/index.html b/docs/news/index.html index 2fcfb759..949b2327 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ AMR (for R) - 1.7.1.9064 + 1.7.1.9065 @@ -157,19 +157,19 @@
- +
-

Last updated: 11 December 2021

+

Last updated: 11 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). This is now the default EUCAST guideline in the package (all older guidelines are still available) for eucast_rules(), mo_intrinsic_resistant() and mdro(). The intrinsic_resistant data set was also updated accordingly.

  • Support for Danish, and also added missing translations of all antimicrobial drugs in Italian, French and Portuguese

  • @@ -183,7 +183,7 @@
  • Function ab_ddd_units() to get units of DDDs (daily defined doses), deprecating the use of ab_ddd(..., units = TRUE) to be more consistent in data types of function output

-

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)
    • @@ -252,7 +252,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.
diff --git a/inst/tinytest/test-mdro.R b/inst/tinytest/test-mdro.R index 057975c4..853197a2 100755 --- a/inst/tinytest/test-mdro.R +++ b/inst/tinytest/test-mdro.R @@ -30,6 +30,8 @@ expect_error(mdro(example_isolates, col_mo = "invalid", info = TRUE)) expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, info = TRUE)))) expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.1", info = TRUE)))) +expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.2", info = TRUE)))) +expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.3", info = TRUE)))) expect_stdout(outcome <- suppressMessages(suppressWarnings(eucast_exceptional_phenotypes(example_isolates, info = TRUE)))) # check class expect_identical(class(outcome), c("ordered", "factor"))