-
-
-
+
Note: the rules of ‘EUCAST Clinical Breakpoints v11.0 (2021)’ are now implemented.
@@ -259,9 +218,9 @@
library(dplyr)
example_isolates %>%
- mutate(bacteria = mo_fullname(mo)) %>%
- filter(mo_is_gram_negative(), mo_is_intrinsic_resistant(ab = "cefotax")) %>%
- select(bacteria, aminoglycosides(), carbapenems())
+ mutate(bacteria = mo_fullname(mo)) %>%
+ filter(mo_is_gram_negative(), mo_is_intrinsic_resistant(ab = "cefotax")) %>%
+ select(bacteria, aminoglycosides(), carbapenems())
#> NOTE: Using column 'mo' as input for mo_is_gram_negative()
#> NOTE: Using column 'mo' as input for mo_is_intrinsic_resistant()
#> NOTE: Determining intrinsic resistance based on 'EUCAST Expert Rules' and
@@ -270,7 +229,7 @@
#> 'KAN' (kanamycin) and 'TOB' (tobramycin)
#> Selecting carbapenems: columns 'IPM' (imipenem) and 'MEM' (meropenem)
With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (mo_is_gram_negative()
and mo_is_intrinsic_resistant()
) and a column selection on two antibiotic groups (aminoglycosides()
and carbapenems()
), the reference data about all microorganisms and all antibiotics in the AMR
package make sure you get what you meant:
-
+
- ab_class() aminoglycosides() carbapenems() cephalosporins() cephalosporins_1st() cephalosporins_2nd() cephalosporins_3rd() cephalosporins_4th() cephalosporins_5th() fluoroquinolones() glycopeptides() macrolides() oxazolidinones() penicillins() tetracyclines()
+ ab_class() aminoglycosides() betalactams() carbapenems() cephalosporins() cephalosporins_1st() cephalosporins_2nd() cephalosporins_3rd() cephalosporins_4th() cephalosporins_5th() fluoroquinolones() glycopeptides() macrolides() oxazolidinones() penicillins() tetracyclines()
|
Antibiotic Class Selectors |
- filter_ab_class() filter_aminoglycosides() filter_carbapenems() filter_cephalosporins() filter_1st_cephalosporins() filter_2nd_cephalosporins() filter_3rd_cephalosporins() filter_4th_cephalosporins() filter_5th_cephalosporins() filter_fluoroquinolones() filter_glycopeptides() filter_macrolides() filter_oxazolidinones() filter_penicillins() filter_tetracyclines()
+ filter_ab_class() filter_aminoglycosides() filter_betalactams() filter_carbapenems() filter_cephalosporins() filter_1st_cephalosporins() filter_2nd_cephalosporins() filter_3rd_cephalosporins() filter_4th_cephalosporins() filter_5th_cephalosporins() filter_fluoroquinolones() filter_glycopeptides() filter_macrolides() filter_oxazolidinones() filter_penicillins() filter_tetracyclines()
|
Filter Isolates on Result in Antimicrobial Class |
diff --git a/docs/reference/key_antimicrobials.html b/docs/reference/key_antimicrobials.html
index 503a497b3..6ceb6dfc2 100644
--- a/docs/reference/key_antimicrobials.html
+++ b/docs/reference/key_antimicrobials.html
@@ -82,7 +82,7 @@
AMR (for R)
- 1.6.0.9021
+ 1.6.0.9044
@@ -323,7 +323,7 @@
Details
- The key_antimicrobials()
and all_antimicrobials()
functions are context-aware. This means that then the x
argument can be left blank, see Examples.
+ The key_antimicrobials()
and all_antimicrobials()
functions are context-aware. This means that the x
argument can be left blank if used inside a data.frame call, see Examples.
The function key_antimicrobials()
returns a character vector with 12 antimicrobial results for every isolate. The function all_antimicrobials()
returns a character vector with all antimicrobial results for every isolate. These vectors can then be compared using antimicrobials_equal()
, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."
) by key_antimicrobials()
and ignored by antimicrobials_equal()
.
Please see the first_isolate()
function how these important functions enable the 'phenotype-based' method for determination of first isolates.
The default antimicrobial agents used for all rows (set in universal
) are:
diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html
index c16f313f9..5c7e45e05 100644
--- a/docs/reference/mdro.html
+++ b/docs/reference/mdro.html
@@ -82,7 +82,7 @@
AMR (for R)
- 1.6.0.9021
+ 1.6.0.9044
@@ -330,7 +330,7 @@ Ordered factor with levels Details
- These functions are context-aware. This means that then the x
argument can be left blank, see Examples.
+ These functions are context-aware. This means that the x
argument can be left blank if used inside a data.frame call, see Examples.
For the pct_required_classes
argument, values above 1 will be divided by 100. This is to support both fractions (0.75
or 3/4
) and percentages (75
).
Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro()
function makes sure that results from before 2016 and after 2016 are identical.
Supported International / National Guidelines
diff --git a/docs/survey.html b/docs/survey.html
index 545868837..64c890fd5 100644
--- a/docs/survey.html
+++ b/docs/survey.html
@@ -81,7 +81,7 @@
AMR (for R)
- 1.6.0.9043
+ 1.6.0.9044
diff --git a/inst/tinytest/test-ab_class_selectors.R b/inst/tinytest/test-ab_class_selectors.R
index 76bf9a23a..824a139a3 100644
--- a/inst/tinytest/test-ab_class_selectors.R
+++ b/inst/tinytest/test-ab_class_selectors.R
@@ -23,20 +23,21 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
-if (pkg_is_available("dplyr")) {
- expect_true(example_isolates %>% select(aminoglycosides()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(carbapenems()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins_1st()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins_2nd()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins_3rd()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins_4th()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(cephalosporins_5th()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(fluoroquinolones()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(glycopeptides()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(macrolides()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(oxazolidinones()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(penicillins()) %>% ncol() < ncol(example_isolates))
- expect_true(example_isolates %>% select(tetracyclines()) %>% ncol() < ncol(example_isolates))
+if (as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) >= 3.2) {
+ # antibiotic class selectors require at least R-3.2
+ expect_true(ncol(example_isolates[, aminoglycosides(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, betalactams(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, carbapenems(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins_1st(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins_2nd(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins_3rd(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins_4th(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, cephalosporins_5th(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, fluoroquinolones(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, glycopeptides(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, macrolides(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, oxazolidinones(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, penicillins(), drop = FALSE]) < ncol(example_isolates))
+ expect_true(ncol(example_isolates[, tetracyclines(), drop = FALSE]) < ncol(example_isolates))
}
-
diff --git a/inst/tinytest/test-filter_ab_class.R b/inst/tinytest/test-filter_ab_class.R
index a8132cf5c..60d36f64f 100644
--- a/inst/tinytest/test-filter_ab_class.R
+++ b/inst/tinytest/test-filter_ab_class.R
@@ -26,13 +26,14 @@
if (pkg_is_available("dplyr")) {
expect_true(example_isolates %>% filter_ab_class("carbapenem") %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_aminoglycosides() %>% nrow() < nrow(example_isolates))
+ expect_true(example_isolates %>% filter_betalactams() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_carbapenems() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_cephalosporins() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_1st_cephalosporins() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_2nd_cephalosporins() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_3rd_cephalosporins() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_4th_cephalosporins() %>% nrow() < nrow(example_isolates))
- expect_true(example_isolates %>% filter_5th_cephalosporins() %>% nrow() < nrow(example_isolates))
+ expect_true(example_isolates %>% mutate(ceftaroline = CTX) %>% filter_5th_cephalosporins() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_fluoroquinolones() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_glycopeptides() %>% nrow() < nrow(example_isolates))
expect_true(example_isolates %>% filter_macrolides() %>% nrow() < nrow(example_isolates))
diff --git a/man/antibiotic_class_selectors.Rd b/man/antibiotic_class_selectors.Rd
index 9d1edea0c..25cf0d12f 100644
--- a/man/antibiotic_class_selectors.Rd
+++ b/man/antibiotic_class_selectors.Rd
@@ -4,6 +4,7 @@
\alias{antibiotic_class_selectors}
\alias{ab_class}
\alias{aminoglycosides}
+\alias{betalactams}
\alias{carbapenems}
\alias{cephalosporins}
\alias{cephalosporins_1st}
@@ -23,6 +24,8 @@ ab_class(ab_class, only_rsi_columns = FALSE)
aminoglycosides(only_rsi_columns = FALSE)
+betalactams(only_rsi_columns = FALSE)
+
carbapenems(only_rsi_columns = FALSE)
cephalosporins(only_rsi_columns = FALSE)
@@ -61,6 +64,8 @@ These functions help to select the columns of antibiotics that are of a specific
\strong{\Sexpr{ifelse(as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) < 3.2, paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}}
All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the \link{antibiotics} data set. This means that a selector like e.g. \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
+
+The group of betalactams consists of all carbapenems, cephalosporins and penicillins.
}
\section{Stable Lifecycle}{
diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd
index f019b1853..678c1615e 100644
--- a/man/filter_ab_class.Rd
+++ b/man/filter_ab_class.Rd
@@ -3,6 +3,7 @@
\name{filter_ab_class}
\alias{filter_ab_class}
\alias{filter_aminoglycosides}
+\alias{filter_betalactams}
\alias{filter_carbapenems}
\alias{filter_cephalosporins}
\alias{filter_1st_cephalosporins}
@@ -35,6 +36,14 @@ filter_aminoglycosides(
...
)
+filter_betalactams(
+ x,
+ result = NULL,
+ scope = "any",
+ only_rsi_columns = FALSE,
+ ...
+)
+
filter_carbapenems(
x,
result = NULL,
@@ -157,6 +166,8 @@ Filter isolates on results in specific antimicrobial classes. This makes it easy
}
\details{
All columns of \code{x} will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a filter function like e.g. \code{\link[=filter_aminoglycosides]{filter_aminoglycosides()}} will include column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
+
+The group of betalactams consists of all carbapenems, cephalosporins and penicillins.
}
\section{Stable Lifecycle}{