diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 94a609b1c..8c023b03d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -56,16 +56,18 @@ jobs: - {os: windows-latest, r: 'devel', allowfail: false} - {os: windows-latest, r: 'release', allowfail: false} - {os: windows-latest, r: 'oldrel', allowfail: false} - - {os: ubuntu-16.04, r: 'devel', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-16.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: 'oldrel', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-16.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-16.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-16.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.4', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.3', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - # - {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - # older R versions cannot be tested, since tidyverse only supports last 4 R x.x versions + - {os: ubuntu-16.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.0', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} @@ -80,13 +82,14 @@ jobs: - uses: r-lib/actions/setup-pandoc@master - name: Query dependencies + if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' run: | install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) shell: Rscript {0} - name: Cache R packages - if: runner.os != 'Windows' + if: runner.os != 'Windows' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' uses: actions/cache@v1 with: path: ${{ env.R_LIBS_USER }} @@ -94,7 +97,7 @@ jobs: restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3- - name: Install Linux dependencies - if: runner.os == 'Linux' + if: runner.os == 'Linux' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' env: RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | @@ -108,6 +111,7 @@ jobs: brew install mariadb-connector-c - name: Install dependencies + if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' run: | remotes::install_deps(dependencies = TRUE) remotes::install_cran("rcmdcheck") @@ -116,15 +120,25 @@ jobs: - name: Session info run: | options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) + utils::sessionInfo() + as.data.frame(utils::installed.packages())[, "Version", drop = FALSE] shell: Rscript {0} - name: Run R CMD check + if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' env: _R_CHECK_CRAN_INCOMING_: false run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") shell: Rscript {0} + + - name: Run R CMD check on older R versions + if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2' + env: + _R_CHECK_CRAN_INCOMING_: false + _R_CHECK_FORCE_SUGGESTS_: false + run: | + ls -lh + R CMD check data-raw/AMR_*.tar.gz - name: Show testthat output if: always() diff --git a/DESCRIPTION b/DESCRIPTION index e40deb167..982cbec94 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.4.0.9052 -Date: 2020-12-28 +Version: 1.4.0.9053 +Date: 2020-12-29 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 3adf75337..0c10e5a89 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 1.4.0.9052 -## Last updated: 28 December 2020 +# AMR 1.4.0.9053 +## Last updated: 29 December 2020 ### New * Functions `get_episode()` and `is_new_episode()` to determine (patient) episodes which are not necessarily based on microorganisms. The `get_episode()` function returns the index number of the episode per group, while the `is_new_episode()` function returns values `TRUE`/`FALSE` to indicate whether an item in a vector is the start of a new episode. They also support `dplyr`s grouping (i.e. using `group_by()`): diff --git a/R/ab_from_text.R b/R/ab_from_text.R index 948922daf..813472e86 100644 --- a/R/ab_from_text.R +++ b/R/ab_from_text.R @@ -33,7 +33,7 @@ #' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name". #' @param thorough_search logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words. #' @param ... arguments passed on to [as.ab()] -#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. +#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems. #' #' ## Argument `type` #' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling. diff --git a/R/mo.R b/R/mo.R index b90954a00..4aeaf127a 100755 --- a/R/mo.R +++ b/R/mo.R @@ -2006,5 +2006,3 @@ repair_reference_df <- function(reference_df) { reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE]) reference_df } - -pkg_env <- new.env(hash = FALSE) diff --git a/R/mo_property.R b/R/mo_property.R index 6599ca3d9..9ddbb4ddf 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -433,12 +433,11 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_locale(), ...) { stop_("length of `x` and `ab` must be equal, or one of them must be of length 1.") } - # show used version number once per session - if (is.null(getOption("AMR_intrinsic_resistance_note", NULL))) { + # show used version number once + if (message_not_thrown_before("intrinsic_resistant_version")) { message_("Determining intrinsic resistance based on ", - format_eucast_version_nr(3.2, FALSE), ". ", - font_bold("This note is shown only once per session.")) - options(AMR_intrinsic_resistance_note = "shown") + format_eucast_version_nr(3.2, markdown = FALSE), ".") + remember_thrown_message("intrinsic_resistant_version") } # runs against internal vector: INTRINSIC_R (see zzz.R) diff --git a/R/zzz.R b/R/zzz.R index ef6fd4861..4f75c05f2 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -23,6 +23,9 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # +# set up package environment, used by numerous AMR functions +pkg_env <- new.env(hash = FALSE) + .onLoad <- function(libname, pkgname) { assign(x = "AB_lookup", diff --git a/README.md b/README.md index efeca9492..9357c481f 100755 --- a/README.md +++ b/README.md @@ -2,8 +2,11 @@ # `AMR` (for R) -[![CRAN_Badge](https://www.r-pkg.org/badges/version-ago/AMR)](https://cran.R-project.org/package=AMR) [![CRAN_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](https://cran.R-project.org/package=AMR) -[![CodeCov](https://codecov.io/gh/msberends/AMR/branch/master/graph/badge.svg)](https://codecov.io/gh/msberends/AMR/branch/master) +[![CRAN](https://www.r-pkg.org/badges/version-ago/AMR)](https://cran.r-project.org/package=AMR) +[![CRANlogs](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](https://cran.r-project.org/package=AMR) +![R-code-check](https://github.com/msberends/AMR/workflows/R-code-check/badge.svg?branch=master) +[![CodeFactor](https://www.codefactor.io/repository/github/msberends/amr/badge)](https://www.codefactor.io/repository/github/msberends/amr) +[![Codecov](https://codecov.io/gh/msberends/AMR/branch/master/graph/badge.svg)](https://codecov.io/gh/msberends/AMR?branch=master) diff --git a/data-raw/AMR_1.4.0.9053.tar.gz b/data-raw/AMR_1.4.0.9053.tar.gz new file mode 100644 index 000000000..c6ed62dfb Binary files /dev/null and b/data-raw/AMR_1.4.0.9053.tar.gz differ diff --git a/docs/404.html b/docs/404.html index e87d8651e..98cbe37ed 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index c139382d2..bc1661827 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 1b29aeb1d..2386ed8af 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 @@ -193,7 +193,7 @@

How to conduct AMR analysis

Matthijs S. Berends

-

26 December 2020

+

29 December 2020

Source: vignettes/AMR.Rmd @@ -202,7 +202,7 @@ -

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 26 December 2020.

+

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 29 December 2020.

Introduction

@@ -233,21 +233,21 @@ -2020-12-26 +2020-12-29 abcd Escherichia coli S S -2020-12-26 +2020-12-29 abcd Escherichia coli S R -2020-12-26 +2020-12-29 efgh Escherichia coli R @@ -352,9 +352,9 @@ -2011-10-28 -I1 -Hospital A +2014-02-24 +H4 +Hospital D Staphylococcus aureus R S @@ -363,41 +363,19 @@ M -2011-06-05 -G5 -Hospital A -Escherichia coli +2017-04-27 +Q3 +Hospital B +Staphylococcus aureus +S R -S -S -S -M - - -2014-05-12 -X7 -Hospital D -Streptococcus pneumoniae -S -S R S F - -2011-02-23 -K5 -Hospital A -Staphylococcus aureus -S -S -S -S -M - -2017-09-20 -T5 +2013-03-12 +Q4 Hospital B Escherichia coli S @@ -407,15 +385,37 @@ F -2017-02-10 -Y6 -Hospital D +2013-03-24 +H9 +Hospital A Escherichia coli -I +R S S S -F +M + + +2017-03-11 +M1 +Hospital A +Streptococcus pneumoniae +R +S +S +S +M + + +2011-12-21 +M5 +Hospital A +Streptococcus pneumoniae +S +S +S +S +M @@ -449,16 +449,16 @@ Longest: 1

1 M -10,426 -52.13% -10,426 -52.13% +10,444 +52.22% +10,444 +52.22% 2 F -9,574 -47.87% +9,556 +47.78% 20,000 100.00% @@ -503,7 +503,7 @@ Longest: 1

# NOTE: Using column 'bacteria' as input for `col_mo`. # NOTE: Using column 'date' as input for `col_date`. # NOTE: Using column 'patient_id' as input for `col_patient_id`.
-

So only 28.4% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

+

So only 28.3% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

 data_1st <- data %>% 
   filter(first == TRUE)
@@ -515,7 +515,7 @@ Longest: 1

First weighted isolates

-

We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient F3, sorted on date:

+

We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient Z4, sorted on date:

@@ -531,43 +531,43 @@ Longest: 1

- - + + - - + + - - + + + - - + - - + + - + - - + + - + @@ -575,19 +575,19 @@ Longest: 1

- - + + + - - + - - + + @@ -597,51 +597,51 @@ Longest: 1

- - + + - - - + + + - - + + - + - - + + - - + + - - + + - - + - + +
isolate
12010-01-17F32010-07-01Z4 B_ESCHR_COLI S SRRSS TRUE
22010-03-13F32010-08-01Z4 B_ESCHR_COLII SSSR S FALSE
32010-04-21F32010-08-18Z4 B_ESCHR_COLI RSI R S FALSE
42010-06-24F32010-10-16Z4 B_ESCHR_COLISR S S S
52010-08-02F32010-12-23Z4 B_ESCHR_COLIR S SSSR FALSE
62010-08-14F32010-12-25Z4 B_ESCHR_COLI S S
72010-10-06F32011-01-07Z4 B_ESCHR_COLISSSRRR S FALSE
82010-10-17F32011-01-30Z4 B_ESCHR_COLI RRS S S FALSE
92010-11-17F32011-05-19Z4 B_ESCHR_COLIRI S SRS FALSE
102011-02-21F32011-06-21Z4 B_ESCHR_COLIRRS S RTRUESFALSE
-

Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

+

Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

If a column exists with a name like ‘key(…)ab’ the first_isolate() function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:

 data <- data %>% 
@@ -665,46 +665,46 @@ Longest: 1

1 -2010-01-17 -F3 +2010-07-01 +Z4 B_ESCHR_COLI S S -R -R +S +S TRUE TRUE 2 -2010-03-13 -F3 +2010-08-01 +Z4 B_ESCHR_COLI +I S -S -S +R S FALSE TRUE 3 -2010-04-21 -F3 +2010-08-18 +Z4 B_ESCHR_COLI R -S +I R S FALSE -TRUE +FALSE 4 -2010-06-24 -F3 +2010-10-16 +Z4 B_ESCHR_COLI -S +R S S S @@ -713,47 +713,47 @@ Longest: 1

5 -2010-08-02 -F3 +2010-12-23 +Z4 B_ESCHR_COLI +R S S -S -S -FALSE +R FALSE +TRUE 6 -2010-08-14 -F3 +2010-12-25 +Z4 B_ESCHR_COLI S S S S FALSE -FALSE +TRUE 7 -2010-10-06 -F3 +2011-01-07 +Z4 B_ESCHR_COLI -S -S -S +R +R +R S FALSE -FALSE +TRUE 8 -2010-10-17 -F3 +2011-01-30 +Z4 B_ESCHR_COLI R -R +S S S FALSE @@ -761,36 +761,36 @@ Longest: 1

9 -2010-11-17 -F3 +2011-05-19 +Z4 B_ESCHR_COLI +S +S R -I -S S FALSE -FALSE +TRUE 10 -2011-02-21 -F3 +2011-06-21 +Z4 B_ESCHR_COLI -R -R +S S R -TRUE -TRUE +S +FALSE +FALSE -

Instead of 2, now 6 isolates are flagged. In total, 78.5% of all isolates are marked ‘first weighted’ - 50.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

+

Instead of 1, now 8 isolates are flagged. In total, 79.0% of all isolates are marked ‘first weighted’ - 50.7% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

As with filter_first_isolate(), there’s a shortcut for this new algorithm too:

 data_1st <- data %>% 
   filter_first_weighted_isolate()
-

So we end up with 15,695 isolates for analysis.

+

So we end up with 15,805 isolates for analysis.

We can remove unneeded columns:

 data_1st <- data_1st %>% 
@@ -800,7 +800,6 @@ Longest: 1

head(data_1st)
-@@ -816,7 +815,6 @@ Longest: 1

- @@ -833,10 +831,9 @@ Longest: 1

- - - - + + + @@ -849,9 +846,38 @@ Longest: 1

- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -865,67 +891,33 @@ Longest: 1

- - - - + + + - - - + + + - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -949,8 +941,8 @@ Longest: 1

data_1st %>% freq(genus, species)

Frequency table

Class: character
-Length: 15,695
-Available: 15,695 (100%, NA: 0 = 0%)
+Length: 15,805
+Available: 15,805 (100%, NA: 0 = 0%)
Unique: 4

Shortest: 16
Longest: 24

@@ -968,32 +960,32 @@ Longest: 24

- + - + - - - - + + + + - - - - + + + + - - - + + + @@ -1020,33 +1012,33 @@ Longest: 24

- - - + + + - - - + + + - + - + - + - + @@ -1054,16 +1046,16 @@ Longest: 24

- - + + - - - - + + + +
date patient_id hospital
12011-10-28I1Hospital A2014-02-24H4Hospital D B_STPHY_AURS R S TRUE
22011-06-05G52017-04-27Q3Hospital BB_STPHY_AURSRRRSFGram-positiveStaphylococcusaureusTRUE
2013-03-12Q4Hospital BB_ESCHR_COLISSRSFGram-negativeEscherichiacoliTRUE
2013-03-24H9 Hospital A B_ESCHR_COLI R TRUE
32014-05-12X7Hospital D2017-03-11M1Hospital A B_STRPT_PNMNSS R RFSRM Gram-positive Streptococcus pneumoniae TRUE
42011-02-23K52011-12-21M5 Hospital AB_STPHY_AURSB_STRPT_PNMN S S SSMGram-positiveStaphylococcusaureusTRUE
52017-09-20T5Hospital BB_ESCHR_COLISS RSFGram-negativeEscherichiacoliTRUE
72017-12-17Z3Hospital BB_ESCHR_COLISSSSFGram-negativeEscherichiacoliMGram-positiveStreptococcuspneumoniae TRUE
1 Escherichia coli 7,82849.88%49.53% 7,82849.88%49.53%
2 Staphylococcus aureus3,97725.34%11,80575.22%3,96325.07%11,79174.60%
3 Streptococcus pneumoniae2,32014.78%14,12590.00%2,39215.13%14,18389.74%
4 Klebsiella pneumoniae1,57010.00%15,6951,62210.26%15,805 100.00%
E. coli AMX3731275382237772453806 7828
E. coli AMC6146297138561592781391 7828
E. coli CIP59185997 019101831 7828
E. coli GEN70876984 0741844 7828
AMX 0 01570157016221622
K. pneumoniae AMC12315728215701271632881622
@@ -1072,7 +1064,7 @@ Longest: 24

data_1st %>% select(bacteria, fluoroquinolones()) %>% bug_drug_combinations()
-
# Selecting fluoroquinolones: 'CIP' (ciprofloxacin)
+
# Selecting fluoroquinolones: column 'CIP' (ciprofloxacin)
@@ -1086,34 +1078,34 @@ Longest: 24

- + - + - + - - + + - + - - + + - + - - + +
mo
E. coli CIP59185997 019101831 7828
K. pneumoniae CIP11911266 037915703561622
S. aureus CIP30453017 093239779463963
S. pneumoniae CIP17851844 053523205482392
@@ -1126,7 +1118,7 @@ Longest: 24

As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R(), equal to resistance()) and susceptibility as the proportion of S and I (proportion_SI(), equal to susceptibility()). These functions can be used on their own:

 data_1st %>% resistance(AMX)
-# [1] 0.536604
+# [1] 0.5358431

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

 data_1st %>% 
@@ -1141,19 +1133,19 @@ Longest: 24

Hospital A -0.5429950 +0.5273258 Hospital B -0.5429998 +0.5421512 Hospital C -0.5283993 +0.5394139 Hospital D -0.5222153 +0.5350195 @@ -1173,23 +1165,23 @@ Longest: 24

Hospital A -0.5429950 -4768 +0.5273258 +4794 Hospital B -0.5429998 -5407 +0.5421512 +5504 Hospital C -0.5283993 -2324 +0.5394139 +2423 Hospital D -0.5222153 -3196 +0.5350195 +3084 @@ -1211,27 +1203,27 @@ Longest: 24

Escherichia -0.8230710 -0.9053398 -0.9872253 +0.8223045 +0.8921819 +0.9842872 Klebsiella -0.8203822 -0.9076433 -0.9847134 +0.8224414 +0.8927250 +0.9833539 Staphylococcus -0.8287654 -0.9192859 -0.9894393 +0.8268988 +0.9192531 +0.9861216 Streptococcus -0.5379310 +0.5447324 0.0000000 -0.5379310 +0.5447324 diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png index 74c7a6051..d9d509e21 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png index 38c861803..2ff7ab8ff 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png index 537e4ec26..8b71ff58e 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png index 1d36ff570..8d6a1c409 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html index 83aad23a4..ce5e1e906 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0
diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 5d6c140fb..ac82c95a2 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 @@ -311,19 +311,19 @@ Unique: 2

 head(my_TB_data)
 #   rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1          R         I            R          S            I            S
-# 2          I         S            I          S            S            R
-# 3          I         I            I          R            I            R
-# 4          S         S            I          S            R            I
-# 5          I         R            S          R            S            R
-# 6          I         I            I          R            S            I
+# 1          S         R            S          S            I            R
+# 2          R         I            S          I            S            I
+# 3          I         I            R          S            I            S
+# 4          R         S            R          I            R            S
+# 5          I         R            I          I            I            R
+# 6          I         R            I          R            S            R
 #   kanamycin
-# 1         S
+# 1         R
 # 2         I
 # 3         I
-# 4         S
-# 5         I
-# 6         R
+# 4 I +# 5 S +# 6 S

We can now add the interpretation of MDR-TB to our data set. You can use:

 mdro(my_TB_data, guideline = "TB")
@@ -354,40 +354,40 @@ Unique: 5

1 Mono-resistant -3219 -64.38% -3219 -64.38% +3286 +65.72% +3286 +65.72% 2 Negative -982 -19.64% -4201 -84.02% +992 +19.84% +4278 +85.56% 3 Multi-drug-resistant -434 -8.68% -4635 -92.70% +424 +8.48% +4702 +94.04% 4 Poly-resistant -251 -5.02% -4886 -97.72% +214 +4.28% +4916 +98.32% 5 Extensively drug-resistant -114 -2.28% +84 +1.68% 5000 100.00% diff --git a/docs/articles/PCA.html b/docs/articles/PCA.html index 4d16497f3..83613b0af 100644 --- a/docs/articles/PCA.html +++ b/docs/articles/PCA.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/articles/SPSS.html b/docs/articles/SPSS.html index 8cfee5fe3..a802f7639 100644 --- a/docs/articles/SPSS.html +++ b/docs/articles/SPSS.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 @@ -193,7 +193,7 @@

How to import data from SPSS / SAS / Stata

Matthijs S. Berends

-

26 December 2020

+

29 December 2020

Source: vignettes/SPSS.Rmd diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index bdf561427..8073149bd 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index 5d223b311..e7b6b63f1 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 @@ -227,20 +227,34 @@ times = 10) print(S.aureus, unit = "ms", signif = 2) # Unit: milliseconds -# expr min lq mean median uq max neval -# as.mo("sau") 9.9 11 19.0 12.0 13.0 47.0 10 -# as.mo("stau") 100.0 110 130.0 130.0 140.0 150.0 10 -# as.mo("STAU") 110.0 110 130.0 140.0 140.0 150.0 10 -# as.mo("staaur") 11.0 11 15.0 12.0 13.0 40.0 10 -# as.mo("STAAUR") 12.0 12 21.0 13.0 40.0 46.0 10 -# as.mo("S. aureus") 26.0 31 45.0 34.0 60.0 86.0 10 -# as.mo("S aureus") 26.0 29 36.0 31.0 33.0 58.0 10 -# as.mo("Staphylococcus aureus") 1.6 2 2.3 2.3 2.7 2.8 10 -# as.mo("Staphylococcus aureus (MRSA)") 880.0 900 910.0 910.0 920.0 950.0 10 -# as.mo("Sthafilokkockus aaureuz") 370.0 370 380.0 380.0 380.0 400.0 10 -# as.mo("MRSA") 9.9 11 18.0 13.0 14.0 47.0 10 -# as.mo("VISA") 17.0 19 29.0 21.0 48.0 50.0 10 -# as.mo("VRSA") 16.0 19 29.0 20.0 47.0 55.0 10
+# expr min lq mean median uq max +# as.mo("sau") 13.0 14.0 25.0 15.0 44.0 65 +# as.mo("stau") 120.0 130.0 140.0 140.0 160.0 160 +# as.mo("STAU") 120.0 130.0 150.0 160.0 160.0 180 +# as.mo("staaur") 13.0 13.0 14.0 14.0 14.0 15 +# as.mo("STAAUR") 13.0 14.0 17.0 15.0 15.0 43 +# as.mo("S. aureus") 30.0 32.0 45.0 34.0 62.0 68 +# as.mo("S aureus") 31.0 34.0 42.0 35.0 61.0 63 +# as.mo("Staphylococcus aureus") 2.5 2.6 2.8 2.8 2.9 3 +# as.mo("Staphylococcus aureus (MRSA)") 1200.0 1200.0 1200.0 1200.0 1200.0 1200 +# as.mo("Sthafilokkockus aaureuz") 550.0 560.0 570.0 560.0 570.0 610 +# as.mo("MRSA") 13.0 13.0 17.0 15.0 15.0 42 +# as.mo("VISA") 21.0 22.0 26.0 23.0 23.0 52 +# as.mo("VRSA") 21.0 23.0 35.0 24.0 52.0 54 +# neval +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10

In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations can take up to 500-1000 times as much time.

To improve performance, two important calculations take almost no time at all: repetitive results and already precalculated results.

@@ -270,8 +284,8 @@ print(run_it, unit = "ms", signif = 3) # Unit: milliseconds # expr min lq mean median uq max neval -# mo_name(x) 136 169 210 198 247 317 10 -

So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.198 seconds. You only lose time on your unique input values.

+# mo_name(x) 141 180 218 207 245 312 10 +

So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.207 seconds. You only lose time on your unique input values.

@@ -285,10 +299,10 @@ print(run_it, unit = "ms", signif = 3) # Unit: milliseconds # expr min lq mean median uq max neval -# A 7.21 7.32 7.92 7.69 8.49 9.43 10 -# B 22.60 23.50 28.90 24.70 26.10 69.20 10 -# C 1.87 1.92 2.10 2.08 2.27 2.34 10

-

So going from mo_name("Staphylococcus aureus") to "Staphylococcus aureus" takes 0.0021 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:

+# A 8.76 8.96 9.39 9.31 9.86 10.10 10 +# B 27.60 28.20 33.00 28.90 29.40 71.20 10 +# C 2.28 2.32 2.47 2.45 2.48 2.85 10 +

So going from mo_name("Staphylococcus aureus") to "Staphylococcus aureus" takes 0.0025 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:

 run_it <- microbenchmark(A = mo_species("aureus"),
                          B = mo_genus("Staphylococcus"),
@@ -302,14 +316,14 @@
 print(run_it, unit = "ms", signif = 3)
 # Unit: milliseconds
 #  expr  min   lq mean median   uq  max neval
-#     A 1.34 1.59 1.66   1.65 1.74 2.18    10
-#     B 1.34 1.63 1.73   1.72 1.85 2.31    10
-#     C 1.41 1.61 1.65   1.65 1.72 1.83    10
-#     D 1.59 1.63 1.77   1.77 1.89 2.03    10
-#     E 1.33 1.60 1.68   1.65 1.73 2.08    10
-#     F 1.31 1.34 1.56   1.52 1.71 2.11    10
-#     G 1.34 1.60 1.75   1.64 1.76 2.74    10
-#     H 1.32 1.38 1.57   1.63 1.71 1.78    10
+# A 1.91 1.95 2.06 1.99 2.09 2.62 10 +# B 1.83 1.91 2.09 2.04 2.20 2.45 10 +# C 1.79 1.90 2.03 1.99 2.22 2.30 10 +# D 1.90 2.01 2.18 2.12 2.25 2.71 10 +# E 1.91 2.02 2.14 2.08 2.15 2.81 10 +# F 1.86 1.92 2.00 2.01 2.06 2.16 10 +# G 1.81 1.96 2.09 2.08 2.22 2.41 10 +# H 1.90 1.93 2.05 2.00 2.22 2.29 10

Of course, when running mo_phylum("Firmicutes") the function has zero knowledge about the actual microorganism, namely S. aureus. But since the result would be "Firmicutes" anyway, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.

@@ -337,13 +351,13 @@ print(run_it, unit = "ms", signif = 4) # Unit: milliseconds # expr min lq mean median uq max neval -# en 15.73 16.35 20.85 16.74 17.71 56.56 100 -# de 18.96 19.62 22.32 19.86 20.46 59.58 100 -# nl 31.06 31.91 37.31 32.78 34.57 75.58 100 -# es 18.92 19.59 23.43 19.92 20.42 62.72 100 -# it 18.80 19.36 22.59 19.74 20.54 62.72 100 -# fr 18.88 19.53 23.89 19.85 20.91 61.56 100 -# pt 18.89 19.51 21.46 19.87 20.29 59.12 100
+# en 17.45 18.01 19.69 18.53 19.14 55.30 100 +# de 20.58 21.54 26.69 22.08 23.96 67.16 100 +# nl 33.79 34.67 39.13 35.39 36.72 74.60 100 +# es 20.71 21.42 24.36 21.88 22.65 58.57 100 +# it 20.65 21.18 26.50 21.53 22.68 61.96 100 +# fr 20.68 21.27 25.05 21.64 22.37 58.82 100 +# pt 20.69 21.44 24.36 21.94 22.99 59.66 100

Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.

diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png index 19a9dea91..431f27bfc 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index a8e6ad888..d2bddbd94 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/articles/index.html b/docs/articles/index.html index ee4823467..2c8fb79fa 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 79bf768c1..e6b545a3f 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/articles/welcome_to_AMR.html b/docs/articles/welcome_to_AMR.html index 7e649944a..40898fcb8 100644 --- a/docs/articles/welcome_to_AMR.html +++ b/docs/articles/welcome_to_AMR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/authors.html b/docs/authors.html index bcd08a4b9..55f84d285 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/index.html b/docs/index.html index 513736a6b..179b38c9e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/news/index.html b/docs/news/index.html index 2c955b9fa..f8c2edc24 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 @@ -236,13 +236,13 @@ Source: NEWS.md -
-

-AMR 1.4.0.9052 Unreleased +
+

+AMR 1.4.0.9053 Unreleased

-
+

-Last updated: 28 December 2020 +Last updated: 29 December 2020

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 0c9053524..bdfdf68ed 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2020-12-28T21:24Z +last_built: 2020-12-29T20:22Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index b0a7f1ea1..f4b3e9408 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0

diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index c8496e0fe..3cd74c812 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0
diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index 74ba73e94..0c1b23266 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0
diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index 54233c883..a0fbb4569 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0
diff --git a/docs/reference/ab_from_text.html b/docs/reference/ab_from_text.html index 3e66899a7..92c2e880b 100644 --- a/docs/reference/ab_from_text.html +++ b/docs/reference/ab_from_text.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.4.0.9053

@@ -285,7 +285,7 @@

A list, or a character if collapse is not NULL

Details

-

This function is also internally used by as.ab(), although it then only searches for the first drug name and will throw a note if more drug names could have been returned.

Argument type

+

This function is also internally used by as.ab(), although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the as.ab() function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.

Argument type

At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses as.ab() internally, it will correct for misspelling.

diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 51c5c6d6c..c3df214b6 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/age.html b/docs/reference/age.html index 6705c9ab2..cf72930e7 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 1a277aebb..65f7daff9 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html index c97bd1a65..727915426 100644 --- a/docs/reference/antibiotic_class_selectors.html +++ b/docs/reference/antibiotic_class_selectors.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9051 + 1.5.0 diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 81f79ab4f..6c60e9e89 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index 2af884817..3181dbd9a 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index cf0f59c6a..1bc1e5fa3 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index d5260a2e4..a66a2c082 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index becd12958..f562904d8 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 55e2cc3fa..c678db22a 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index 3281db165..89994ec70 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/availability.html b/docs/reference/availability.html index af2e53a75..fda075da2 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index 799d2f780..3f31ab6f8 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index f3e3bc1cc..139f75764 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index b35010b71..97c6fcfe1 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/count.html b/docs/reference/count.html index 564fe9752..d12114b8b 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 19dc97f55..dd498d359 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 1.4.0.9052 + 1.5.0 @@ -289,7 +289,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied ampc_cephalosporin_resistance -

a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to NA. Currently only works when version_expertrules is 3.2; 'EUCAST Expert Rules v3.2 on Enterobacterales' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of NA for this argument will remove results for these agents, while e.g. a value of "R" will make the results for these agents resistant. Use NULL to not alter the results for AmpC de-repressed cephalosporin-resistant mutants.
For EUCAST Expert Rules v3.2, this rule applies to: Enterobacter, Klebsiella aerogenes, Citrobacter freundii, Hafnia alvei, Serratia, Morganella morganii, Providencia.

+

a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to NA. Currently only works when version_expertrules is 3.2; 'EUCAST Expert Rules v3.2 on Enterobacterales' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of NA for this argument will remove results for these agents, while e.g. a value of "R" will make the results for these agents resistant. Use NULL to not alter the results for AmpC de-repressed cephalosporin-resistant mutants.
For EUCAST Expert Rules v3.2, this rule applies to: Enterobacter, Klebsiella aerogenes, Citrobacter braakii, freundii, gillenii, murliniae, rodenticum, sedlakii, werkmanii, youngae, Hafnia alvei, Serratia, Morganella morganii, Providencia.

... diff --git a/docs/reference/example_isolates.html b/docs/reference/example_isolates.html index 70b373bb1..df9289b6f 100644 --- a/docs/reference/example_isolates.html +++ b/docs/reference/example_isolates.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/example_isolates_unclean.html b/docs/reference/example_isolates_unclean.html index fb89c297d..5bacd5e94 100644 --- a/docs/reference/example_isolates_unclean.html +++ b/docs/reference/example_isolates_unclean.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index d0bc8f158..4175bf3d6 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9051 + 1.5.0 diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index e1dc82be1..f66c3d980 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index ae075c6e5..bf77d494f 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/get_episode.html b/docs/reference/get_episode.html index f780af553..30cfb64c2 100644 --- a/docs/reference/get_episode.html +++ b/docs/reference/get_episode.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html index 0d086ee2d..c1d9d9742 100644 --- a/docs/reference/ggplot_pca.html +++ b/docs/reference/ggplot_pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index c30a6bd49..d279f4d8e 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index b13893b70..c020ca264 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/index.html b/docs/reference/index.html index 0ccbdb494..74170f49e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/docs/reference/intrinsic_resistant.html b/docs/reference/intrinsic_resistant.html index 6b9b67230..8e4efe2be 100644 --- a/docs/reference/intrinsic_resistant.html +++ b/docs/reference/intrinsic_resistant.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/join.html b/docs/reference/join.html index e70d453dc..d2bb0dd4c 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index 6e95e09b4..4daf9c010 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index f9dacfb52..18a5cd9fa 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/lifecycle.html b/docs/reference/lifecycle.html index 7b22cef17..3de9ec5dc 100644 --- a/docs/reference/lifecycle.html +++ b/docs/reference/lifecycle.html @@ -84,7 +84,7 @@ This page contains a section for every lifecycle (with text borrowed from the af AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/like.html b/docs/reference/like.html index 31a8a7cf0..fc00ba0ef 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 0bd0d11a1..8c40d3035 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index 033c8fbd4..aa86be6ea 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 100f9da6f..00a182653 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 9b64ce450..0ea63b273 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/mo_matching_score.html b/docs/reference/mo_matching_score.html index 6578ef4d2..3cd1361d3 100644 --- a/docs/reference/mo_matching_score.html +++ b/docs/reference/mo_matching_score.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index 766dda357..253f3d4fa 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index ea585b5b0..a924a6328 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -83,7 +83,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/pca.html b/docs/reference/pca.html index 08f03885a..1a517f909 100644 --- a/docs/reference/pca.html +++ b/docs/reference/pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/plot.html b/docs/reference/plot.html index 65478bdd0..a462e4e39 100644 --- a/docs/reference/plot.html +++ b/docs/reference/plot.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index da4aa2f99..2fd9dbcc9 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/random.html b/docs/reference/random.html index 8fe8fa3e2..5ee97d673 100644 --- a/docs/reference/random.html +++ b/docs/reference/random.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 637bfe719..e6a2f9cc0 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9050 + 1.5.0 diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index bcfe6e265..88e33ad2e 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index c4d5ab8a2..60bbe35c6 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -83,7 +83,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/reference/translate.html b/docs/reference/translate.html index fcd33ebe0..f195c4e9b 100644 --- a/docs/reference/translate.html +++ b/docs/reference/translate.html @@ -82,7 +82,7 @@ AMR (for R) - 1.4.0.9046 + 1.5.0 diff --git a/docs/survey.html b/docs/survey.html index 676900799..246cad471 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9052 + 1.4.0.9053 diff --git a/git_premaster.sh b/git_premaster.sh index e44d92a58..49921590b 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -120,13 +120,21 @@ echo "• Updating internal data •" echo "••••••••••••••••••••••••••" Rscript -e "source('data-raw/internals.R')" echo +echo "••••••••••••••••••••" +echo "• Building package •" +echo "••••••••••••••••••••" +echo "• Removing old build..." +rm data-raw/AMR_*.tar.gz +echo "• Building to 'data-raw'..." +Rscript -e "x <- devtools::build(path = 'data-raw', vignettes = FALSE, manual = FALSE, binary = FALSE, quiet = TRUE)" +echo "• Installing..." +Rscript -e "devtools::install(quiet = TRUE, dependencies = FALSE)" +echo echo "•••••••••••••••••" echo "• Building site •" echo "•••••••••••••••••" -echo "• Installing..." -Rscript -e "devtools::install(quiet = TRUE, dependencies = FALSE)" Rscript -e "suppressMessages(pkgdown::build_site(lazy = $lazy, examples = FALSE))" -# add the survey +# add the survey page Rscript -e "source('data-raw/create_survey_page.R')" echo echo "•••••••••••••••••••••••••" @@ -148,7 +156,7 @@ echo "•••••••••••••••••••••••• # save latest changes as well git add . # and commit -git commit -a -m "(v$new_version) $1" --quiet +git commit -a -m "(v${new_version}) $1" --quiet git push --quiet echo "Comparison:" echo "https://github.com/msberends/AMR/compare/master...premaster?view=inline" diff --git a/man/ab_from_text.Rd b/man/ab_from_text.Rd index 16dbdfc66..f5431f7f8 100644 --- a/man/ab_from_text.Rd +++ b/man/ab_from_text.Rd @@ -33,7 +33,7 @@ A \link{list}, or a \link{character} if \code{collapse} is not \code{NULL} Use this function on e.g. clinical texts from health care records. It returns a \link{list} with all antimicrobial drugs, doses and forms of administration found in the texts. } \details{ -This function is also internally used by \code{\link[=as.ab]{as.ab()}}, although it then only searches for the first drug name and will throw a note if more drug names could have been returned. +This function is also internally used by \code{\link[=as.ab]{as.ab()}}, although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the \code{\link[=as.ab]{as.ab()}} function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems. \subsection{Argument \code{type}}{ At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses \code{\link[=as.ab]{as.ab()}} internally, it will correct for misspelling. diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 852671b3d..110f3f102 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -42,7 +42,7 @@ eucast_rules( \item{version_expertrules}{the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Currently supported: 3.1, 3.2.} -\item{ampc_cephalosporin_resistance}{a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to \code{NA}. Currently only works when \code{version_expertrules} is \code{3.2}; '\emph{EUCAST Expert Rules v3.2 on Enterobacterales}' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of \code{NA} for this argument will remove results for these agents, while e.g. a value of \code{"R"} will make the results for these agents resistant. Use \code{NULL} to not alter the results for AmpC de-repressed cephalosporin-resistant mutants. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Enterobacter, Klebsiella aerogenes, Citrobacter freundii, Hafnia alvei, Serratia, Morganella morganii, Providencia}.} +\item{ampc_cephalosporin_resistance}{a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to \code{NA}. Currently only works when \code{version_expertrules} is \code{3.2}; '\emph{EUCAST Expert Rules v3.2 on Enterobacterales}' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of \code{NA} for this argument will remove results for these agents, while e.g. a value of \code{"R"} will make the results for these agents resistant. Use \code{NULL} to not alter the results for AmpC de-repressed cephalosporin-resistant mutants. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Enterobacter, Klebsiella aerogenes, Citrobacter braakii, freundii, gillenii, murliniae, rodenticum, sedlakii, werkmanii, youngae, Hafnia alvei, Serratia, Morganella morganii, Providencia}.} \item{...}{column name of an antibiotic, please see section \emph{Antibiotics} below} } diff --git a/tests/testthat.R b/tests/testthat.R index e7489675f..09c15c2b6 100755 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -23,7 +23,11 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -library(testthat, warn.conflicts = FALSE) -library(AMR) - -test_check("AMR") +if (require("testthat")) { + # the testthat package is in Suggests, but very old R versions will not be + # able to install it. Yet, we want checks in those R versions as well, so + # only run unit tests in later R versions: + library(testthat, warn.conflicts = FALSE) + library(AMR) + test_check("AMR") +}