-
-
+
+
+
-Last updated: 7 July 2021
+Last updated: 8 July 2021
@@ -249,10 +249,11 @@
- Antibiotic class selectors (see
ab_class()
)
- Fix for duplicate ATC codes in the
antibiotics
data set
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index ad18d624..0aa62aab 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: 2021-07-07T18:31Z
+last_built: 2021-07-08T20:22Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles
diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html
index de09d0d6..f55b0f3b 100644
--- a/docs/reference/antibiotic_class_selectors.html
+++ b/docs/reference/antibiotic_class_selectors.html
@@ -82,7 +82,7 @@
AMR (for R)
- 1.7.1.9014
+ 1.7.1.9016
@@ -242,15 +242,15 @@
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
-
ab_class(ab_class, only_rsi_columns = FALSE)
+ ab_class(ab_class, only_rsi_columns = FALSE, only_treatable = TRUE)
-aminoglycosides(only_rsi_columns = FALSE)
+aminoglycosides(only_rsi_columns = FALSE, only_treatable = TRUE)
aminopenicillins(only_rsi_columns = FALSE)
-betalactams(only_rsi_columns = FALSE)
+betalactams(only_rsi_columns = FALSE, only_treatable = TRUE)
-carbapenems(only_rsi_columns = FALSE)
+carbapenems(only_rsi_columns = FALSE, only_treatable = TRUE)
cephalosporins(only_rsi_columns = FALSE)
@@ -278,7 +278,7 @@
penicillins(only_rsi_columns = FALSE)
-polymyxins(only_rsi_columns = FALSE)
+polymyxins(only_rsi_columns = FALSE, only_treatable = TRUE)
streptogramins(only_rsi_columns = FALSE)
@@ -299,6 +299,10 @@
only_rsi_columns |
a logical to indicate whether only columns of class <rsi> must be selected (defaults to FALSE ), see as.rsi() |
+
+ only_treatable |
+ a logical to indicate whether agents that are only for laboratory tests should be excluded (defaults to TRUE ), such as gentamicin-high (GEH ) and imipenem/EDTA (IPE ) |
+
Details
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 9e3b0a96..63e92da0 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -81,7 +81,7 @@
AMR (for R)
- 1.7.1.9015
+ 1.7.1.9016
diff --git a/docs/survey.html b/docs/survey.html
index a694a586..136835e7 100644
--- a/docs/survey.html
+++ b/docs/survey.html
@@ -81,7 +81,7 @@
AMR (for R)
- 1.7.1.9015
+ 1.7.1.9016
diff --git a/inst/tinytest/test-mo_property.R b/inst/tinytest/test-mo_property.R
index ea6f94e2..62bd2934 100644
--- a/inst/tinytest/test-mo_property.R
+++ b/inst/tinytest/test-mo_property.R
@@ -28,20 +28,17 @@ expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli"))
expect_equal(mo_phylum("Escherichia coli"), "Proteobacteria")
expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria")
expect_equal(mo_order("Escherichia coli"), "Enterobacterales")
-
-# S3 class for taxonomic names
-expect_inherits(mo_family("Escherichia coli"), "taxonomic_name")
-expect_equal(as.character(mo_family("Escherichia coli")), "Enterobacteriaceae")
-expect_equal(as.character(mo_fullname("Escherichia coli")), "Escherichia coli")
-expect_equal(as.character(mo_genus("Escherichia coli")), "Escherichia")
-expect_equal(as.character(mo_name("Escherichia coli")), "Escherichia coli")
-expect_equal(as.character(mo_shortname("Escherichia coli")), "E. coli")
-expect_equal(as.character(mo_shortname("Escherichia")), "Escherichia")
-expect_equal(as.character(mo_shortname("Staphylococcus aureus")), "S. aureus")
-expect_equal(as.character(mo_shortname("Staphylococcus aureus", Becker = TRUE)), "S. aureus")
-expect_equal(as.character(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en")), "CoPS")
-expect_equal(as.character(mo_shortname("Streptococcus agalactiae")), "S. agalactiae")
-expect_equal(as.character(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE)), "GBS")
+expect_equal(mo_family("Escherichia coli"), "Enterobacteriaceae")
+expect_equal(mo_fullname("Escherichia coli"), "Escherichia coli")
+expect_equal(mo_genus("Escherichia coli"), "Escherichia")
+expect_equal(mo_name("Escherichia coli"), "Escherichia coli")
+expect_equal(mo_shortname("Escherichia coli"), "E. coli")
+expect_equal(mo_shortname("Escherichia"), "Escherichia")
+expect_equal(mo_shortname("Staphylococcus aureus"), "S. aureus")
+expect_equal(mo_shortname("Staphylococcus aureus", Becker = TRUE), "S. aureus")
+expect_equal(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en"), "CoPS")
+expect_equal(mo_shortname("Streptococcus agalactiae"), "S. agalactiae")
+expect_equal(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE), "GBS")
expect_equal(mo_species("Escherichia coli"), "coli")
expect_equal(mo_subspecies("Escherichia coli"), "")
@@ -68,7 +65,7 @@ expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de")
# test integrity
MOs <- microorganisms
-expect_identical(MOs$fullname, as.character(mo_fullname(MOs$fullname, language = "en")))
+expect_identical(MOs$fullname, mo_fullname(MOs$fullname, language = "en"))
# check languages
expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien")
@@ -84,7 +81,7 @@ expect_stdout(print(mo_gramstain("Escherichia coli", language = "fr")))
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
dutch <- mo_name(microorganisms$fullname, language = "nl") # should be transformable to English again
-expect_identical(as.character(mo_name(dutch, language = NULL)), microorganisms$fullname) # gigantic test - will run ALL names
+expect_identical(mo_name(dutch, language = NULL), microorganisms$fullname) # gigantic test - will run ALL names
# manual property function
expect_error(mo_property("Escherichia coli", property = c("tsn", "fullname")))
@@ -120,7 +117,7 @@ expect_equal(mo_is_intrinsic_resistant(c("Escherichia coli", "Staphylococcus aur
"vanco"),
c(TRUE, FALSE, FALSE))
# with reference data
-expect_equal(as.character(mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI"))),
+expect_equal(mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI")),
"Escherichia coli")
if (AMR:::pkg_is_available("dplyr")) {
expect_equal(example_isolates %>% filter(mo_is_gram_negative()) %>% nrow(),
diff --git a/man/antibiotic_class_selectors.Rd b/man/antibiotic_class_selectors.Rd
index d793936a..4d809d95 100644
--- a/man/antibiotic_class_selectors.Rd
+++ b/man/antibiotic_class_selectors.Rd
@@ -27,15 +27,15 @@
\alias{ureidopenicillins}
\title{Antibiotic Class Selectors}
\usage{
-ab_class(ab_class, only_rsi_columns = FALSE)
+ab_class(ab_class, only_rsi_columns = FALSE, only_treatable = TRUE)
-aminoglycosides(only_rsi_columns = FALSE)
+aminoglycosides(only_rsi_columns = FALSE, only_treatable = TRUE)
aminopenicillins(only_rsi_columns = FALSE)
-betalactams(only_rsi_columns = FALSE)
+betalactams(only_rsi_columns = FALSE, only_treatable = TRUE)
-carbapenems(only_rsi_columns = FALSE)
+carbapenems(only_rsi_columns = FALSE, only_treatable = TRUE)
cephalosporins(only_rsi_columns = FALSE)
@@ -63,7 +63,7 @@ oxazolidinones(only_rsi_columns = FALSE)
penicillins(only_rsi_columns = FALSE)
-polymyxins(only_rsi_columns = FALSE)
+polymyxins(only_rsi_columns = FALSE, only_treatable = TRUE)
streptogramins(only_rsi_columns = FALSE)
@@ -77,6 +77,8 @@ ureidopenicillins(only_rsi_columns = FALSE)
\item{ab_class}{an antimicrobial class, such as \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
\item{only_rsi_columns}{a \link{logical} to indicate whether only columns of class \verb{
} must be selected (defaults to \code{FALSE}), see \code{\link[=as.rsi]{as.rsi()}}}
+
+\item{only_treatable}{a \link{logical} to indicate whether agents that are only for laboratory tests should be excluded (defaults to \code{TRUE}), such as gentamicin-high (\code{GEH}) and imipenem/EDTA (\code{IPE})}
}
\description{
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.