diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 598e404b..df7ddcd9 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -52,35 +52,33 @@ jobs: fail-fast: false matrix: config: - # these are the developmental version of R - we allow those tests to fail - # - {os: macOS-latest, r: 'devel', allowfail: false} - # - {os: windows-latest, r: 'devel', allowfail: false} - # - {os: ubuntu-20.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - # # test all systems against all released versions of R >= 3.0, we support them all! - # - {os: macOS-latest, r: '4.1', allowfail: false} + # test all systems against all released versions of R >= 3.0, we support them all! + - {os: macOS-latest, r: 'devel', allowfail: true} + - {os: macOS-latest, r: '4.1', allowfail: false} + - {os: macOS-latest, r: '4.0', allowfail: false} + - {os: macOS-latest, r: '3.6', allowfail: false} + - {os: macOS-latest, r: '3.5', allowfail: false} + - {os: macOS-latest, r: '3.4', allowfail: false} + - {os: macOS-latest, r: '3.3', allowfail: false} + - {os: macOS-latest, r: '3.2', allowfail: false} + - {os: ubuntu-20.04, r: 'devel', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '4.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.2', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: windows-latest, r: 'devel', allowfail: true} - {os: windows-latest, r: '4.1', allowfail: false} - # - {os: ubuntu-20.04, r: '4.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '4.0', allowfail: false} - {os: windows-latest, r: '4.0', allowfail: false} - # - {os: ubuntu-20.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '3.6', allowfail: false} - {os: windows-latest, r: '3.6', allowfail: false} - # - {os: ubuntu-20.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '3.5', allowfail: false} - {os: windows-latest, r: '3.5', allowfail: false} - # - {os: ubuntu-20.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '3.4', allowfail: false} - {os: windows-latest, r: '3.4', allowfail: false} - # - {os: ubuntu-20.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '3.3', allowfail: false} - {os: windows-latest, r: '3.3', allowfail: false} - # - {os: ubuntu-20.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: macOS-latest, r: '3.2', allowfail: false} - {os: windows-latest, r: '3.2', allowfail: false} - # - {os: ubuntu-20.04, r: '3.2', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: ubuntu-20.04, r: '3.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - # - {os: ubuntu-20.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true diff --git a/DESCRIPTION b/DESCRIPTION index 007fda78..21e23126 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.7.1.9036 -Date: 2021-08-30 +Version: 1.7.1.9037 +Date: 2021-08-31 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 b3927b46..7d898e3a 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# `AMR` 1.7.1.9036 -## Last updated: 30 August 2021 +# `AMR` 1.7.1.9037 +## Last updated: 31 August 2021 ### Breaking changes * Removed `p_symbol()` and all `filter_*()` functions (except for `filter_first_isolate()`), which were all deprecated in a previous package version diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index faed3505..97efc167 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -728,18 +728,14 @@ meet_criteria <- function(object, return(invisible()) } -get_current_data <- function(arg_name, call, requires_cur_data = FALSE) { +get_current_data <- function(arg_name, call) { # 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)) { - message("==> RETURNING cur_data_all()") return(structure(out, type = "dplyr_cur_data_all")) } } @@ -752,17 +748,14 @@ get_current_data <- function(arg_name, call, requires_cur_data = FALSE) { if (!is.null(env$`.data`) && is.data.frame(env$`.data`)) { # an element `.data` will be in the environment when using `dplyr::select()` # (but not when using `dplyr::filter()`, `dplyr::mutate()` or `dplyr::summarise()`) - message("==> RETURNING dplyr_selector") return(structure(env$`.data`, type = "dplyr_selector")) } else if (!is.null(env$xx) && is.data.frame(env$xx)) { # an element `xx` will be in the environment for rows + cols, e.g. `example_isolates[c(1:3), carbapenems()]` - message("==> RETURNING base_R 1") return(structure(env$xx, type = "base_R")) } else if (!is.null(env$x) && is.data.frame(env$x)) { # an element `x` will be in the environment for only cols, e.g. `example_isolates[, carbapenems()]` - message("==> RETURNING base_R 2") return(structure(env$x, type = "base_R")) } } diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 4851f849..d02a0ff5 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/data-raw/_install_deps.R b/data-raw/_install_deps.R index fa57d708..cdfc7fc0 100644 --- a/data-raw/_install_deps.R +++ b/data-raw/_install_deps.R @@ -40,7 +40,7 @@ if (length(to_install) == 0) { for (i in seq_len(length(to_install))) { cat("Installing package", to_install[i], "\n") tryCatch(install.packages(to_install[i], - type = ifelse(.Platform$OS.type == "unix", "source", "binary"), + # type = ifelse(.Platform$OS.type == "unix", "source", "binary"), repos = "https://cran.rstudio.com/", dependencies = c("Depends", "Imports"), quiet = FALSE), diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 37a14e37..831092ea 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.7.1.9036 + 1.7.1.9037 @@ -190,7 +190,7 @@ @@ -240,12 +240,12 @@ Source: NEWS.md -
-

- Unreleased AMR 1.7.1.9036

-
+
+

+ Unreleased AMR 1.7.1.9037

+

-Last updated: 30 August 2021 +Last updated: 31 August 2021

diff --git a/inst/tinytest/test-first_isolate.R b/inst/tinytest/test-first_isolate.R index 2d6afd98..f6e48fcd 100755 --- a/inst/tinytest/test-first_isolate.R +++ b/inst/tinytest/test-first_isolate.R @@ -117,14 +117,12 @@ if (AMR:::pkg_is_available("dplyr")) { first_isolate(col_date = "date", col_mo = "mo", col_patient_id = "patient_id", - info = FALSE, - require_cur_data = TRUE), + info = FALSE), example_isolates %>% first_isolate(col_date = "date", col_mo = "mo", col_patient_id = "patient_id", - info = FALSE, - require_cur_data = TRUE)) + info = FALSE)) # support for WHONET expect_message(example_isolates %>% @@ -135,8 +133,8 @@ if (AMR:::pkg_is_available("dplyr")) { first_isolate(info = TRUE)) # groups - x <- example_isolates %>% group_by(ward_icu) %>% mutate(first = first_isolate(require_cur_data = TRUE)) - y <- example_isolates %>% group_by(ward_icu) %>% mutate(first = first_isolate(., require_cur_data = TRUE)) + x <- example_isolates %>% group_by(ward_icu) %>% mutate(first = first_isolate()) + y <- example_isolates %>% group_by(ward_icu) %>% mutate(first = first_isolate(.)) expect_identical(x, y) }