diff --git a/DESCRIPTION b/DESCRIPTION index bf448496..a20afd31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.7.1.9033 +Version: 1.7.1.9035 Date: 2021-08-30 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 5fe02526..89eb5e96 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# `AMR` 1.7.1.9033 +# `AMR` 1.7.1.9035 ## Last updated: 30 August 2021 ### Breaking changes diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index d5b47017..faed3505 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -298,7 +298,7 @@ stop_ifnot_installed <- function(package) { pkg_is_available <- function(pkg, also_load = TRUE) { if (also_load == TRUE) { - out <- suppressWarnings(require(pkg, character.only = TRUE, warn.conflicts = FALSE, quietly = TRUE)) + out <- suppressWarnings(require(pkg, character.only = TRUE, warn.conflicts = FALSE)) } else { out <- requireNamespace(pkg, quietly = TRUE) } @@ -728,11 +728,14 @@ meet_criteria <- function(object, return(invisible()) } -get_current_data <- function(arg_name, call) { +get_current_data <- function(arg_name, call, requires_cur_data = FALSE) { # try dplyr::cur_data_all() first to support dplyr groups # only useful for e.g. dplyr::filter(), dplyr::mutate() and dplyr::summarise() # not useful (throws error) with e.g. dplyr::select() - but that will be caught later in this function cur_data_all <- import_fn("cur_data_all", "dplyr", error_on_fail = FALSE) + if (isTRUE(requires_cur_data)) { + print(cur_data_all()) + } if (!is.null(cur_data_all)) { out <- tryCatch(cur_data_all(), error = function(e) NULL) if (is.data.frame(out)) { diff --git a/R/first_isolate.R b/R/first_isolate.R index 39440fb6..1b5b43f7 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -204,7 +204,7 @@ first_isolate <- function(x = NULL, if (is_null_or_grouped_tbl(x)) { # when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all()) # is also fix for using a grouped df as input (a dot as first argument) - x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x) + x <- tryCatch(get_current_data(arg_name = "x", call = -2, requires_cur_data = list(...)$require_cur_data), error = function(e) x) } meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0 meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x)) diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 727d4bf2..ff1794e6 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 69d1b88e..bac7a7de 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.7.1.9033 + 1.7.1.9035 @@ -1256,7 +1256,7 @@ If you are reading this page from within R, please

-

Developed by Matthijs S. Berends, Christian F. Luz, Alexander W. Friedrich, Bhanu N. M. Sinha, Casper J. Albers, Corinna Glasner.

+

Developed by Matthijs S. Berends, Christian F. Luz.

diff --git a/docs/news/index.html b/docs/news/index.html index d71668d4..32151e08 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -92,7 +92,7 @@ AMR (for R) - 1.7.1.9033 + 1.7.1.9035
@@ -240,9 +240,9 @@ Source: NEWS.md -
-

- Unreleased AMR 1.7.1.9033

+
+

+ Unreleased AMR 1.7.1.9035

Last updated: 30 August 2021 @@ -2044,7 +2044,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/