diff --git a/DESCRIPTION b/DESCRIPTION index 3fd5df79..669cbbd8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.7.0.9002 -Date: 2021-06-01 +Version: 1.7.1 +Date: 2021-06-03 Title: Antimicrobial Resistance Data Analysis Authors@R: c( person(role = c("aut", "cre"), @@ -43,7 +43,6 @@ Depends: R (>= 3.0.0) Suggests: cleaner, - covr, curl, dplyr, ggplot2, diff --git a/NEWS.md b/NEWS.md index 820f36e3..139173ea 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,18 +1,8 @@ -# `AMR` 1.7.0.9002 -## Last updated: 1 June 2021 - -### New -* Support for CLSI 2020 guideline for interpreting MICs and disk diffusion values (using `as.rsi()`) - -### Changed -* `bug_drug_combinations()` now supports grouping using the `dplyr` package -* As requested by CRAN administrators: decreased package size by 3 MB in costs of a ~50 times slower loading time of the package (i.e., `library(AMR)`) - - -# `AMR` 1.7.0 +# `AMR` 1.7.1 ### Breaking change -* All antibiotic class selectors (such as `carbapenems()`, `aminoglycosides()`) can now be used for filtering as well, making all their accompanying `filter_*()` functions redundant (such as `filter_carbapenems()`, `filter_aminoglycosides()`). These functions are now deprecated and will be removed in a next release. +* Support for CLSI 2020 guideline for interpreting MICs and disk diffusion values (using `as.rsi()`) +* All antibiotic class selectors (such as `carbapenems()`, `aminoglycosides()`) can now be used for filtering as well, making all their accompanying `filter_*()` functions redundant (such as `filter_carbapenems()`, `filter_aminoglycosides()`). These functions are now deprecated and will be removed in a next release. Examples of how the selectors can be used for filtering: ```r # select columns with results for carbapenems example_isolates[, carbapenems()] # base R @@ -45,6 +35,7 @@ ### Changed +* `bug_drug_combinations()` now supports grouping using the `dplyr` package * Custom MDRO guidelines (`mdro()`, `custom_mdro_guideline()`): * Custom MDRO guidelines can now be combined with other custom MDRO guidelines using `c()` * Fix for applying the rules; in previous versions, rows were interpreted according to the last matched rule. Now, rows are interpreted according to the first matched rule @@ -77,6 +68,7 @@ * `age()` now vectorises over both `x` and `reference` ### Other +* As requested by CRAN administrators: decreased package size by 3 MB in costs of a slower loading time of the package * All unit tests are now processed by the `tinytest` package, instead of the `testthat` package. The `testthat` package unfortunately requires tons of dependencies that are also heavy and only usable for recent R versions, disallowing developers to test a package under any R 3.* version. On the contrary, the `tinytest` package is very lightweight and dependency-free. diff --git a/R/ab_class_selectors.R b/R/ab_class_selectors.R index ce103cb6..d897d022 100644 --- a/R/ab_class_selectors.R +++ b/R/ab_class_selectors.R @@ -73,6 +73,11 @@ #' \donttest{ #' if (require("dplyr")) { #' +#' # get AMR for all aminoglycosides e.g., per hospital: +#' example_isolates %>% +#' group_by(hospital_id) %>% +#' summarise(across(aminoglycosides(), resistance)) +#' #' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem): #' example_isolates %>% #' select(carbapenems()) diff --git a/R/sysdata.rda b/R/sysdata.rda index 51680594..d9cd9bdb 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/README.md b/README.md index 901c244e..4b8a62a2 100755 --- a/README.md +++ b/README.md @@ -23,14 +23,7 @@ This is the development source of the `AMR` package for R. Not a developer? Then ### How to get this package Please see [our website](https://msberends.github.io/AMR/#get-this-package). -You have to add [our R-universe address](https://msberends.r-universe.dev) to your list of repositories ('repos'), by running: - -```r -options(repos = c(getOption("repos"), - msberends = "https://msberends.r-universe.dev")) -``` - -You can now install or update the `AMR` package in the same way you are used to: +You can install or update the `AMR` package from CRAN using: ```r install.packages("AMR") diff --git a/cran-comments.md b/cran-comments.md index efd52128..4347495f 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1 +1 @@ -* This package now has a data folder size of ~2.8 MB (this was ~5.6 MB), which will return a NOTE on R CMD CHECK. The package size is needed to provide users reference data for the complete taxonomy of microorganisms - one of the most important features of this package. This was written and explained in a manuscript that was accepted for publication in the Journal of Statistical Software earlier this year. We will add the paper as a vignette after publication in a next version. All data sets were compressed using `compression = "xz"` to make them as small as possible. We try to update as infrequent as possible. +* This package now has a data folder size of ~2.8 MB (this was ~5.6 MB), which will return a NOTE on R CMD CHECK. This package size is needed to provide users reference data for the complete taxonomy of microorganisms - one of the most important features of this package, following 15 previous releases of this package. All data sets were compressed using `compression = "xz"` to make them as small as possible. diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index dafcaadc..7564a482 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/data-raw/_internals.R b/data-raw/_internals.R index c7fbf430..2bbed1bc 100644 --- a/data-raw/_internals.R +++ b/data-raw/_internals.R @@ -146,7 +146,6 @@ usethis::use_data(eucast_rules_file, LANGUAGES_SUPPORTED, MO_CONS, MO_COPS, - AB_lookup, AMINOGLYCOSIDES, AMINOPENICILLINS, CARBAPENEMS, diff --git a/docs/404.html b/docs/404.html index dbf8025b..e400ee9d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4efddbc9..ca124220 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index eb643e82..fa7113c9 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -39,7 +39,7 @@ @@ -193,7 +193,7 @@vignettes/AMR.Rmd
AMR.Rmd
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 May 2021.
+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 03 June 2021.
So only 52.8% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 53.2% 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)
data_1st <- data %>%
filter_first_isolate()
So we end up with 10,550 isolates for analysis. Now our data looks like:
+So we end up with 10,645 isolates for analysis. Now our data looks like:
head(data_1st)
1 | -2013-04-02 | -X1 | -Hospital D | -B_ESCHR_COLI | -R | -R | -S | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -||||
2 | -2015-07-17 | -X6 | -Hospital A | -B_STPHY_AURS | -R | -R | -S | -S | -F | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -||||
4 | -2010-02-11 | -D2 | -Hospital B | -B_ESCHR_COLI | -S | -S | -S | -S | -M | -Gram-negative | -Escherichia | -coli | -TRUE | -||||
6 | -2016-01-30 | -S3 | +2013-08-17 | +V3 | Hospital D | -B_KLBSL_PNMN | -R | +B_STPHY_AURS | R | S | S | +S | F | -Gram-negative | -Klebsiella | -pneumoniae | -TRUE | -
7 | -2012-10-20 | -D10 | -Hospital B | -B_STPHY_AURS | -R | -R | -R | -S | -M | Gram-positive | Staphylococcus | aureus | TRUE | ||||
8 | -2016-03-28 | -K7 | +3 | +2011-02-20 | +B1 | Hospital C | B_STRPT_PNMN | S | @@ -648,6 +584,70 @@ Longest: 1pneumoniae | TRUE | |||||||
5 | +2010-04-22 | +F1 | +Hospital B | +B_ESCHR_COLI | +S | +S | +S | +S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +||||
7 | +2014-07-28 | +W5 | +Hospital B | +B_STPHY_AURS | +R | +S | +S | +S | +F | +Gram-positive | +Staphylococcus | +aureus | +TRUE | +||||
8 | +2015-01-06 | +V3 | +Hospital A | +B_ESCHR_COLI | +R | +I | +S | +R | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +||||
9 | +2014-03-16 | +H4 | +Hospital A | +B_STPHY_AURS | +R | +S | +R | +S | +M | +Gram-positive | +Staphylococcus | +aureus | +TRUE | +
Time for the analysis!
@@ -669,8 +669,8 @@ Longest: 1data_1st %>% freq(genus, species)
Frequency table
Class: character
-Length: 10,550
-Available: 10,550 (100.0%, NA: 0 = 0.0%)
+Length: 10,645
+Available: 10,645 (100.0%, NA: 0 = 0.0%)
Unique: 4
Shortest: 16
Longest: 24
If you want to get a quick glance of the number of isolates in different bug/drug combinations, you can use the bug_drug_combinations()
function:
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.5443602
Or can be used in conjunction with group_by()
and summarise()
, both from the dplyr
package:
data_1st %>%
@@ -991,19 +991,19 @@ Longest: 24
Hospital A
-0.5542598
+0.5461634
Hospital B
-0.5400160
+0.5394702
Hospital C
-0.5508217
+0.5609756
Hospital D
-0.5322972
+0.5316215
@@ -1022,23 +1022,23 @@ Longest: 24
Hospital A
-0.5542598
-3087
+0.5461634
+3206
Hospital B
-0.5400160
-3761
+0.5394702
+3737
Hospital C
-0.5508217
-1643
+0.5609756
+1599
Hospital D
-0.5322972
-2059
+0.5316215
+2103
@@ -1059,27 +1059,27 @@ Longest: 24
Escherichia
-0.7667543
-0.8723171
-0.9770039
+0.7714961
+0.8731728
+0.9776440
Klebsiella
-0.8294970
-0.9062234
-0.9795396
+0.8287385
+0.8930660
+0.9824561
Staphylococcus
-0.7910983
-0.8937545
-0.9852836
+0.7882653
+0.8906706
+0.9839650
Streptococcus
-0.5387654
+0.5414230
0.0000000
-0.5387654
+0.5414230
@@ -1163,16 +1163,16 @@ Longest: 24
mic_values <- random_mic(size = 100)
mic_values
# Class <mic>
-# [1] 2 2 16 4 0.125 0.5 64 16 128 32
-# [11] 4 32 1 0.125 128 2 8 64 64 2
-# [21] 8 0.125 0.25 1 16 64 0.25 0.5 0.25 4
-# [31] 16 32 0.25 1 0.5 8 64 2 0.25 0.0625
-# [41] 128 1 2 2 0.0625 0.125 64 8 8 8
-# [51] 4 8 0.125 1 128 1 128 2 2 0.5
-# [61] 32 64 16 32 32 16 4 1 16 2
-# [71] 1 0.125 2 4 0.125 32 2 0.125 8 0.25
-# [81] 0.0625 4 0.5 16 128 8 128 0.125 0.0625 1
-# [91] 1 0.25 0.0625 128 128 8 0.0625 32 128 0.25
# base R:
plot(mic_values)
# base R:
plot(disk_values, mo = "E. coli", ab = "cipro")
head(my_TB_data)
# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1 I I I I S S
-# 2 R I S I I I
-# 3 S R R R R I
-# 4 S R S S R S
-# 5 R S I R S R
-# 6 R R R R I I
+# 1 S I R R R S
+# 2 I R R R R R
+# 3 S S S R I R
+# 4 R I R R S S
+# 5 I R S S R I
+# 6 I S S R R R
# kanamycin
# 1 I
-# 2 I
-# 3 S
+# 2 R
+# 3 R
# 4 R
-# 5 I
-# 6 I
We can now add the interpretation of MDR-TB to our data set. You can use:
mdro(my_TB_data, guideline = "TB")
vignettes/SPSS.Rmd
SPSS.Rmd
R has a huge community.
-Many R users just ask questions on websites like StackOverflow.com, the largest online community for programmers. At the time of writing, 403,383 R-related questions have already been asked on this platform (that covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.
+Many R users just ask questions on websites like StackOverflow.com, the largest online community for programmers. At the time of writing, 404,559 R-related questions have already been asked on this platform (that covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.
R understands any data type, including SPSS/SAS/Stata.
diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index ed2c9f93..124c304f 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -39,7 +39,7 @@ diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index 00de2e4b..b7b83e27 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -39,7 +39,7 @@ @@ -227,18 +227,18 @@ print(S.aureus, unit = "ms", signif = 2) # Unit: milliseconds # expr min lq mean median uq max neval -# as.mo("sau") 10.0 11.0 16.0 11.0 13.0 50 25 -# as.mo("stau") 54.0 58.0 72.0 61.0 89.0 99 25 -# as.mo("STAU") 53.0 55.0 67.0 56.0 91.0 95 25 -# as.mo("staaur") 10.0 11.0 16.0 11.0 13.0 47 25 -# as.mo("STAAUR") 10.0 11.0 17.0 12.0 13.0 58 25 -# as.mo("S. aureus") 26.0 27.0 36.0 31.0 33.0 70 25 -# as.mo("S aureus") 26.0 27.0 40.0 29.0 61.0 68 25 -# as.mo("Staphylococcus aureus") 2.6 3.2 6.5 3.5 3.8 42 25 -# as.mo("Staphylococcus aureus (MRSA)") 240.0 250.0 260.0 260.0 270.0 290 25 -# as.mo("Sthafilokkockus aaureuz") 190.0 190.0 200.0 200.0 210.0 300 25 -# as.mo("MRSA") 10.0 11.0 13.0 12.0 13.0 40 25 -# as.mo("VISA") 18.0 19.0 32.0 20.0 24.0 130 25 +# as.mo("sau") 13.0 13.0 16.0 15.0 16.0 44 25 +# as.mo("stau") 55.0 58.0 75.0 62.0 94.0 110 25 +# as.mo("STAU") 55.0 59.0 77.0 89.0 94.0 100 25 +# as.mo("staaur") 11.0 13.0 20.0 14.0 16.0 48 25 +# as.mo("STAAUR") 11.0 13.0 17.0 15.0 16.0 49 25 +# as.mo("S. aureus") 26.0 30.0 41.0 32.0 60.0 68 25 +# as.mo("S aureus") 27.0 29.0 44.0 32.0 58.0 160 25 +# as.mo("Staphylococcus aureus") 3.3 3.9 5.5 4.2 4.7 37 25 +# as.mo("Staphylococcus aureus (MRSA)") 250.0 260.0 280.0 280.0 290.0 320 25 +# as.mo("Sthafilokkockus aaureuz") 170.0 200.0 210.0 200.0 220.0 250 25 +# as.mo("MRSA") 12.0 14.0 21.0 15.0 17.0 56 25 +# as.mo("VISA") 20.0 23.0 33.0 25.0 51.0 59 25In 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 200 milliseconds, this is only 5 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations are up to 200 times slower to determine.
To improve performance, we implemented two important algorithms to save unnecessary calculations: repetitive results and already precalculated results.
@@ -260,8 +260,8 @@ # what do these values look like? They are of class <mo>: head(x) # Class <mo> -# [1] B_STPHY_EPDR B_STRPT_GRPA B_STPHY_AURS B_BCTRD_FRGL B_STPHY_HMNS -# [6] B_STPHY_CONS +# [1] B_STPHY_CONS B_ESCHR_COLI B_STPHY_AURS B_STRPT_PYGN B_ESCHR_COLI +# [6] B_HMPHL_INFL # as the example_isolates data set has 2,000 rows, we should have 2 million items length(x) @@ -277,8 +277,8 @@ print(run_it, unit = "ms", signif = 3) # Unit: milliseconds # expr min lq mean median uq max neval -# mo_name(x) 187 223 233 226 229 318 10 -So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.226 seconds. That is 113 nanoseconds on average. You only lose time on your unique input values.
+# mo_name(x) 165 238 258 246 253 369 10 +So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.246 seconds. That is 123 nanoseconds on average. You only lose time on your unique input values.
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0019 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:
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0022 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"),
@@ -308,15 +308,15 @@
times = 10)
print(run_it, unit = "ms", signif = 3)
# Unit: milliseconds
-# expr min lq mean median uq max neval
-# A 1.42 1.45 1.56 1.50 1.57 2.00 10
-# B 1.43 1.46 1.49 1.47 1.55 1.59 10
-# C 1.41 1.43 1.58 1.49 1.57 2.19 10
-# D 1.41 1.48 1.61 1.54 1.63 2.33 10
-# E 1.41 1.45 1.64 1.51 1.56 2.68 10
-# F 1.42 1.52 1.63 1.57 1.71 1.99 10
-# G 1.41 1.46 1.65 1.56 1.90 1.98 10
-# H 1.42 1.46 1.59 1.55 1.70 1.88 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 contains all phyla of all known bacteria, it can just return the initial value immediately.
Currently supported non-English languages 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 85aab75d..6dcb7940 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 57a32e65..1873e506 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ @@ -192,7 +192,7 @@vignettes/datasets.Rmd
datasets.Rmd
A data set with 21,996 rows and 10 columns, containing the following column names:
guideline, method, site, mo, ab, ref_tbl, disk_dose, breakpoint_S, breakpoint_R and uti.
This data set is in R available as rsi_translation
, after you load the AMR
package.
It was last updated on 1 June 2021 14:31:18 UTC. Find more info about the structure of this data set here.
+It was last updated on 1 June 2021 14:47:11 UTC. Find more info about the structure of this data set here.
Direct download links:
This package is available here on the rOpenSci R-universe platform, as CRAN does not allow frequent updates of large packages (though the AMR
package is only 7-9 MB). We are working on splitting this package into two: a new data package containing the microbial taxonomy, and the AMR
package that only contains all functions.
In the meanwhile, you have to add our R-universe address to your list of repositories (‘repos’), by running:
+ +This package is available here on the official R network (CRAN). Install this package in R from CRAN by using the command:
-You can now install or update the AMR
package in the same way you are used to:
install.packages("AMR")
It will be downloaded and installed automatically. For RStudio, click on the menu Tools > Install Packages… and then type in “AMR” and press Install.
Note: Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.
@@ -390,11 +386,23 @@The latest and unpublished development version can be installed from GitHub using:
-+ +The latest and unpublished development version can be installed from GitHub in two ways:
++
- +
+Directly, using:
+- +install.packages("remotes") # if you haven't already remotes::install_github("msberends/AMR")
- +
+From the rOpenSci R-universe platform, by adding our R-universe address to your list of repositories (‘repos’):
+ +After this, you can install and update this
+AMR
package like any official release (usinginstall.packages("AMR")
or in RStudio via Tools > Check of Package Updates…).You can also download the latest build from our repository: https://github.com/msberends/AMR/raw/master/data-raw/AMR_latest.tar.gz
NEWS.md
- AMR
1.7.0.9002as.rsi()
)bug_drug_combinations()
now supports grouping using the dplyr
packagelibrary(AMR)
)AMR
1.7.0AMR
1.7.1Support for CLSI 2020 guideline for interpreting MICs and disk diffusion values (using as.rsi()
)
All antibiotic class selectors (such as carbapenems()
, aminoglycosides()
) can now be used for filtering as well, making all their accompanying filter_*()
functions redundant (such as filter_carbapenems()
, filter_aminoglycosides()
). These functions are now deprecated and will be removed in a next release.
All antibiotic class selectors (such as carbapenems()
, aminoglycosides()
) can now be used for filtering as well, making all their accompanying filter_*()
functions redundant (such as filter_carbapenems()
, filter_aminoglycosides()
). These functions are now deprecated and will be removed in a next release. Examples of how the selectors can be used for filtering:
# select columns with results for carbapenems
@@ -289,9 +265,9 @@
custom_eucast_rules()
that brings support for custom AMR rules in eucast_rules()
bug_drug_combinations()
now supports grouping using the dplyr
packagemdro()
, custom_mdro_guideline()
):
c()
@@ -365,6 +343,7 @@
tinytest
package, instead of the testthat
package. The testthat
package unfortunately requires tons of dependencies that are also heavy and only usable for recent R versions, disallowing developers to test a package under any R 3.* version. On the contrary, the tinytest
package is very lightweight and dependency-free.AMR
1.6.0Support for EUCAST Clinical Breakpoints v11.0 (2021), effective in the eucast_rules()
function and in as.rsi()
to interpret MIC and disk diffusion values. This is now the default guideline in this package.
AMR
1.5.0Functions 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()
):
Functions random_mic()
, random_disk()
and random_rsi()
for random value generation. The functions random_mic()
and random_disk()
take microorganism names and antibiotic names as input to make generation more realistic.
New argument ampc_cephalosporin_resistance
in eucast_rules()
to correct for AmpC de-repressed cephalosporin-resistant mutants
AMR
1.4.0Support for ‘EUCAST Expert Rules’ / ‘EUCAST Intrinsic Resistance and Unusual Phenotypes’ version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the eucast_rules()
function can now correct for more than 180 different antibiotics and the mdro()
function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The eucast_rules()
function consequently gained the arguments version_breakpoints
(at the moment defaults to v10.0, 2020) and version_expertrules
(at the moment defaults to v3.2, 2020). The example_isolates
data set now also reflects the change from v3.1 to v3.2. The mdro()
function now accepts guideline == "EUCAST3.1"
and guideline == "EUCAST3.2"
.
A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html
Support for skimming classes <rsi>
, <mic>
, <disk>
and <mo>
with the skimr
package
Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.
AMR
1.3.0Function ab_from_text()
to retrieve antimicrobial drug names, doses and forms of administration from clinical texts in e.g. health care records, which also corrects for misspelling since it uses as.ab()
internally
Added argument conserve_capped_values
to as.rsi()
for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of as.rsi()
has not changed, so you need to specifically do as.rsi(..., conserve_capped_values = TRUE)
.
Big speed improvement for using any function on microorganism codes from earlier package versions (prior to AMR
v1.2.0), such as as.mo()
, mo_name()
, first_isolate()
, eucast_rules()
, mdro()
, etc.
AMR
1.1.0pca()
functionggplot_pca()
functionas.mo()
(and consequently all mo_*
functions, that use as.mo()
internally):
AMR
1.0.1Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline
AMR
1.0.0This software is now out of beta and considered stable. Nonetheless, this package will be developed continually.
-as.rsi()
and inferred resistance and susceptibility using eucast_rules()
.Functions susceptibility()
and resistance()
as aliases of proportion_SI()
and proportion_R()
, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.
Renamed data set septic_patients
to example_isolates
Function bug_drug_combinations()
to quickly get a data.frame
with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with mo_shortname()
at default:
as.mo()
(of which some led to additions to the microorganisms
data set). Many thanks to all contributors that helped improving the algorithms.
AMR
0.7.1Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
Function mo_synonyms()
to get all previously accepted taxonomic names of a microorganism
count_df()
and portion_df()
are now lowercaseAMR
0.7.0as.rsi()
on an MIC value (created with as.mic()
), a disk diffusion value (created with the new as.disk()
) or on a complete date set containing columns with MIC or disk diffusion values.mo_name()
as alias of mo_fullname()
@@ -1379,9 +1358,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
mdr_tb()
) and added a new vignette about MDR. Read this tutorial here on our website.first_isolate()
where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.eucast_rules()
where antibiotics from WHONET software would not be recognisedAMR
0.6.1eucast_rules()
with verbose = TRUE
BREAKING: removed deprecated functions, arguments and references to ‘bactid’. Use as.mo()
to identify an MO code.
New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the G-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR.
eucast_rules()
:
AMR
0.5.0count_all
to get all available isolates (that like all portion_*
and count_*
functions also supports summarise
and group_by
), the old n_rsi
is now an alias of count_all
@@ -1742,9 +1721,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
mo_authors
and mo_year
to get specific values about the scientific reference of a taxonomic entryFunctions MDRO
, BRMO
, MRGN
and EUCAST_exceptional_phenotypes
were renamed to mdro
, brmo
, mrgn
and eucast_exceptional_phenotypes
EUCAST_rules
was renamed to eucast_rules
, the old function still exists as a deprecated function
AMR
0.4.0The data set microorganisms
now contains all microbial taxonomic data from ITIS (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via https://itis.gov. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set microorganisms.old
contains all previously known taxonomic names from those kingdoms.
Renamed septic_patients$sex
to septic_patients$gender
Added three antimicrobial agents to the antibiotics
data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)
AMR
0.3.0rsi_df
was removed in favour of new functions portion_R
, portion_IR
, portion_I
, portion_SI
and portion_S
to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old rsi
function. The old function still works, but is deprecated.
@@ -2073,9 +2052,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
resistance_predict
and added more examplesAMR
0.2.0tibble
s and data.table
srsi
class for vectors that contain only invalid antimicrobial interpretationsablist
to antibiotics
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 5a1dd8fa..6b7f70c8 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-06-01T14:35Z
+last_built: 2021-06-03T13:04Z
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 c7838cbe..f0faa5c4 100644
--- a/docs/reference/AMR-deprecated.html
+++ b/docs/reference/AMR-deprecated.html
@@ -82,7 +82,7 @@
# `example_isolates` is a data set available in the AMR package. +# `example_isolates` is a data set available in the AMR package. # See ?example_isolates. # Base R ------------------------------------------------------------------ # select columns 'IPM' (imipenem) and 'MEM' (meropenem) example_isolates[, carbapenems()] - +#>#> IPM MEM +#> 1 <NA> <NA> +#> 2 <NA> <NA> +#> 3 <NA> <NA> +#> 4 <NA> <NA> +#> 5 <NA> <NA> +#> 6 <NA> <NA> +#> 7 <NA> <NA> +#> 8 <NA> <NA> +#> 9 <NA> <NA> +#> 10 <NA> <NA> +#> 11 <NA> <NA> +#> 12 <NA> <NA> +#> 13 S <NA> +#> 14 S <NA> +#> 15 <NA> <NA> +#> 16 S <NA> +#> 17 S <NA> +#> 18 <NA> <NA> +#> 19 <NA> <NA> +#> 20 <NA> <NA> +#> 21 <NA> <NA> +#> 22 S <NA> +#> 23 S <NA> +#> 24 S <NA> +#> 25 <NA> <NA> +#> 26 <NA> <NA> +#> 27 <NA> <NA> +#> 28 <NA> <NA> +#> 29 <NA> <NA> +#> 30 <NA> <NA> +#> 31 <NA> <NA> +#> 32 <NA> <NA> +#> 33 S <NA> +#> 34 S <NA> +#> 35 S <NA> +#> 36 S <NA> +#> 37 <NA> <NA> +#> 38 S <NA> +#> 39 S <NA> +#> 40 <NA> <NA> +#> 41 <NA> <NA> +#> 42 <NA> <NA> +#> 43 <NA> <NA> +#> 44 <NA> <NA> +#> 45 S <NA> +#> 46 <NA> <NA> +#> 47 <NA> <NA> +#> 48 S S +#> 49 S <NA> +#> 50 S <NA> +#> 51 S <NA> +#> 52 <NA> <NA> +#> 53 <NA> <NA> +#> 54 <NA> <NA> +#> 55 <NA> <NA> +#> 56 <NA> <NA> +#> 57 <NA> <NA> +#> 58 <NA> <NA> +#> 59 <NA> <NA> +#> 60 <NA> <NA> +#> 61 <NA> <NA> +#> 62 <NA> <NA> +#> 63 <NA> <NA> +#> 64 <NA> <NA> +#> 65 S <NA> +#> 66 S <NA> +#> 67 S <NA> +#> 68 <NA> <NA> +#> 69 <NA> <NA> +#> 70 <NA> <NA> +#> 71 S <NA> +#> 72 S <NA> +#> 73 S <NA> +#> 74 S <NA> +#> 75 <NA> <NA> +#> 76 S <NA> +#> 77 <NA> <NA> +#> 78 S <NA> +#> 79 S <NA> +#> 80 <NA> <NA> +#> 81 <NA> <NA> +#> 82 <NA> <NA> +#> 83 <NA> <NA> +#> 84 S <NA> +#> 85 S <NA> +#> 86 S <NA> +#> 87 S <NA> +#> 88 S <NA> +#> 89 S <NA> +#> 90 <NA> <NA> +#> 91 <NA> <NA> +#> 92 <NA> <NA> +#> 93 <NA> <NA> +#> 94 <NA> <NA> +#> 95 <NA> <NA> +#> 96 <NA> <NA> +#> 97 <NA> <NA> +#> 98 <NA> <NA> +#> 99 <NA> <NA> +#> 100 <NA> <NA> +#> 101 S <NA> +#> 102 <NA> <NA> +#> 103 <NA> <NA> +#> 104 <NA> <NA> +#> 105 <NA> <NA> +#> 106 <NA> <NA> +#> 107 <NA> <NA> +#> 108 <NA> <NA> +#> 109 <NA> <NA> +#> 110 <NA> <NA> +#> 111 <NA> <NA> +#> 112 <NA> <NA> +#> 113 <NA> <NA> +#> 114 <NA> <NA> +#> 115 <NA> <NA> +#> 116 S <NA> +#> 117 <NA> <NA> +#> 118 S <NA> +#> 119 S <NA> +#> 120 S <NA> +#> 121 S <NA> +#> 122 S <NA> +#> 123 <NA> <NA> +#> 124 <NA> <NA> +#> 125 <NA> <NA> +#> 126 <NA> <NA> +#> 127 <NA> <NA> +#> 128 <NA> <NA> +#> 129 S <NA> +#> 130 S <NA> +#> 131 <NA> <NA> +#> 132 <NA> <NA> +#> 133 <NA> <NA> +#> 134 <NA> <NA> +#> 135 <NA> <NA> +#> 136 <NA> <NA> +#> 137 <NA> <NA> +#> 138 <NA> <NA> +#> 139 S <NA> +#> 140 <NA> <NA> +#> 141 <NA> <NA> +#> 142 <NA> <NA> +#> 143 S <NA> +#> 144 <NA> <NA> +#> 145 <NA> <NA> +#> 146 <NA> <NA> +#> 147 <NA> <NA> +#> 148 <NA> <NA> +#> 149 <NA> <NA> +#> 150 <NA> <NA> +#> 151 <NA> <NA> +#> 152 <NA> <NA> +#> 153 S S +#> 154 S S +#> 155 S S +#> 156 <NA> <NA> +#> 157 <NA> <NA> +#> 158 <NA> <NA> +#> 159 <NA> <NA> +#> 160 S <NA> +#> 161 <NA> <NA> +#> 162 S <NA> +#> 163 <NA> <NA> +#> 164 <NA> <NA> +#> 165 <NA> <NA> +#> 166 <NA> <NA> +#> 167 <NA> <NA> +#> 168 <NA> <NA> +#> 169 <NA> <NA> +#> 170 <NA> <NA> +#> 171 <NA> <NA> +#> 172 <NA> <NA> +#> 173 <NA> <NA> +#> 174 <NA> <NA> +#> 175 <NA> <NA> +#> 176 S <NA> +#> 177 <NA> <NA> +#> 178 <NA> <NA> +#> 179 <NA> <NA> +#> 180 <NA> <NA> +#> 181 <NA> <NA> +#> 182 <NA> <NA> +#> 183 S <NA> +#> 184 S <NA> +#> 185 <NA> <NA> +#> 186 <NA> <NA> +#> 187 <NA> <NA> +#> 188 <NA> <NA> +#> 189 <NA> <NA> +#> 190 <NA> <NA> +#> 191 <NA> <NA> +#> 192 <NA> <NA> +#> 193 <NA> <NA> +#> 194 S <NA> +#> 195 S <NA> +#> 196 <NA> <NA> +#> 197 <NA> <NA> +#> 198 <NA> <NA> +#> 199 S <NA> +#> 200 <NA> <NA> +#> 201 <NA> <NA> +#> 202 <NA> <NA> +#> 203 <NA> <NA> +#> 204 S <NA> +#> 205 S <NA> +#> 206 <NA> <NA> +#> 207 S S +#> 208 S <NA> +#> 209 S <NA> +#> 210 S <NA> +#> 211 S <NA> +#> 212 I <NA> +#> 213 S <NA> +#> 214 <NA> <NA> +#> 215 <NA> <NA> +#> 216 S <NA> +#> 217 <NA> <NA> +#> 218 <NA> <NA> +#> 219 <NA> <NA> +#> 220 <NA> <NA> +#> 221 <NA> <NA> +#> 222 <NA> <NA> +#> 223 <NA> <NA> +#> 224 S <NA> +#> 225 S <NA> +#> 226 S <NA> +#> 227 S <NA> +#> 228 S <NA> +#> 229 <NA> <NA> +#> 230 S <NA> +#> 231 S <NA> +#> 232 S <NA> +#> 233 <NA> <NA> +#> 234 <NA> <NA> +#> 235 <NA> <NA> +#> 236 <NA> <NA> +#> 237 S S +#> 238 S <NA> +#> 239 S <NA> +#> 240 S S +#> 241 S <NA> +#> 242 S S +#> 243 <NA> <NA> +#> 244 <NA> <NA> +#> 245 <NA> <NA> +#> 246 S S +#> 247 S S +#> 248 S S +#> 249 <NA> <NA> +#> 250 <NA> <NA> +#> 251 S S +#> 252 <NA> <NA> +#> 253 S <NA> +#> 254 S <NA> +#> 255 <NA> <NA> +#> 256 <NA> <NA> +#> 257 <NA> <NA> +#> 258 <NA> <NA> +#> 259 <NA> <NA> +#> 260 <NA> <NA> +#> 261 <NA> S +#> 262 <NA> <NA> +#> 263 <NA> <NA> +#> 264 S <NA> +#> 265 S <NA> +#> 266 <NA> <NA> +#> 267 <NA> <NA> +#> 268 <NA> <NA> +#> 269 <NA> <NA> +#> 270 <NA> <NA> +#> 271 <NA> <NA> +#> 272 <NA> <NA> +#> 273 <NA> <NA> +#> 274 <NA> <NA> +#> 275 <NA> <NA> +#> 276 <NA> <NA> +#> 277 <NA> <NA> +#> 278 S S +#> 279 S S +#> 280 S S +#> 281 <NA> <NA> +#> 282 <NA> <NA> +#> 283 <NA> S +#> 284 <NA> S +#> 285 <NA> S +#> 286 <NA> S +#> 287 <NA> <NA> +#> 288 <NA> <NA> +#> 289 <NA> <NA> +#> 290 <NA> <NA> +#> 291 <NA> <NA> +#> 292 <NA> <NA> +#> 293 <NA> <NA> +#> 294 <NA> S +#> 295 <NA> <NA> +#> 296 <NA> <NA> +#> 297 <NA> <NA> +#> 298 S S +#> 299 S S +#> 300 <NA> <NA> +#> 301 <NA> <NA> +#> 302 <NA> <NA> +#> 303 <NA> <NA> +#> 304 <NA> <NA> +#> 305 <NA> <NA> +#> 306 <NA> <NA> +#> 307 S <NA> +#> 308 <NA> <NA> +#> 309 S S +#> 310 <NA> <NA> +#> 311 <NA> <NA> +#> 312 <NA> S +#> 313 S S +#> 314 S S +#> 315 S S +#> 316 S S +#> 317 <NA> <NA> +#> 318 <NA> <NA> +#> 319 <NA> <NA> +#> 320 <NA> S +#> 321 <NA> S +#> 322 S S +#> 323 S S +#> 324 <NA> <NA> +#> 325 <NA> <NA> +#> 326 <NA> <NA> +#> 327 <NA> <NA> +#> 328 <NA> <NA> +#> 329 <NA> <NA> +#> 330 <NA> <NA> +#> 331 <NA> <NA> +#> 332 <NA> <NA> +#> 333 <NA> <NA> +#> 334 <NA> <NA> +#> 335 <NA> <NA> +#> 336 <NA> <NA> +#> 337 R <NA> +#> 338 R <NA> +#> 339 <NA> <NA> +#> 340 S S +#> 341 <NA> <NA> +#> 342 <NA> <NA> +#> 343 S S +#> 344 S <NA> +#> 345 <NA> <NA> +#> 346 <NA> <NA> +#> 347 <NA> <NA> +#> 348 <NA> <NA> +#> 349 <NA> <NA> +#> 350 <NA> S +#> 351 <NA> <NA> +#> 352 <NA> <NA> +#> 353 <NA> <NA> +#> 354 S S +#> 355 <NA> <NA> +#> 356 S S +#> 357 <NA> <NA> +#> 358 S S +#> 359 <NA> <NA> +#> 360 S S +#> 361 S S +#> 362 <NA> <NA> +#> 363 <NA> S +#> 364 <NA> S +#> 365 <NA> S +#> 366 <NA> <NA> +#> 367 <NA> <NA> +#> 368 S S +#> 369 S S +#> 370 S S +#> 371 S S +#> 372 <NA> <NA> +#> 373 <NA> <NA> +#> 374 <NA> <NA> +#> 375 <NA> <NA> +#> 376 <NA> <NA> +#> 377 <NA> <NA> +#> 378 <NA> <NA> +#> 379 <NA> <NA> +#> 380 <NA> <NA> +#> 381 R R +#> 382 <NA> <NA> +#> 383 <NA> <NA> +#> 384 <NA> <NA> +#> 385 S S +#> 386 <NA> <NA> +#> 387 <NA> <NA> +#> 388 <NA> <NA> +#> 389 S S +#> 390 S S +#> 391 S S +#> 392 S <NA> +#> 393 S S +#> 394 <NA> <NA> +#> 395 S S +#> 396 <NA> <NA> +#> 397 <NA> <NA> +#> 398 <NA> <NA> +#> 399 <NA> <NA> +#> 400 S S +#> 401 S S +#> 402 S S +#> 403 S S +#> 404 <NA> <NA> +#> 405 S S +#> 406 <NA> S +#> 407 <NA> S +#> 408 <NA> S +#> 409 S S +#> 410 S S +#> 411 <NA> S +#> 412 <NA> <NA> +#> 413 <NA> <NA> +#> 414 <NA> <NA> +#> 415 S S +#> 416 <NA> <NA> +#> 417 <NA> <NA> +#> 418 <NA> <NA> +#> 419 <NA> <NA> +#> 420 <NA> <NA> +#> 421 <NA> <NA> +#> 422 <NA> <NA> +#> 423 <NA> <NA> +#> 424 S S +#> 425 S S +#> 426 <NA> <NA> +#> 427 <NA> <NA> +#> 428 <NA> <NA> +#> 429 <NA> <NA> +#> 430 <NA> <NA> +#> 431 <NA> <NA> +#> 432 <NA> <NA> +#> 433 <NA> <NA> +#> 434 <NA> <NA> +#> 435 <NA> <NA> +#> 436 <NA> <NA> +#> 437 <NA> <NA> +#> 438 S S +#> 439 S S +#> 440 S S +#> 441 S S +#> 442 <NA> <NA> +#> 443 <NA> S +#> 444 <NA> S +#> 445 <NA> <NA> +#> 446 <NA> <NA> +#> 447 <NA> <NA> +#> 448 <NA> <NA> +#> 449 S S +#> 450 S S +#> 451 <NA> <NA> +#> 452 <NA> <NA> +#> 453 <NA> <NA> +#> 454 <NA> <NA> +#> 455 <NA> <NA> +#> 456 <NA> <NA> +#> 457 S S +#> 458 S S +#> 459 <NA> <NA> +#> 460 <NA> <NA> +#> 461 R R +#> 462 R R +#> 463 R R +#> 464 <NA> <NA> +#> 465 <NA> <NA> +#> 466 <NA> <NA> +#> 467 <NA> S +#> 468 <NA> S +#> 469 S <NA> +#> 470 <NA> <NA> +#> 471 <NA> S +#> 472 <NA> S +#> 473 <NA> S +#> 474 <NA> S +#> 475 <NA> <NA> +#> 476 <NA> <NA> +#> 477 <NA> <NA> +#> 478 S S +#> 479 <NA> <NA> +#> 480 S S +#> 481 S S +#> 482 <NA> S +#> 483 <NA> S +#> 484 <NA> <NA> +#> 485 S S +#> 486 S S +#> 487 <NA> <NA> +#> 488 <NA> S +#> 489 S S +#> 490 S S +#> 491 S S +#> 492 S S +#> 493 <NA> S +#> 494 <NA> S +#> 495 <NA> S +#> 496 <NA> S +#> 497 <NA> <NA> +#> 498 <NA> <NA> +#> 499 <NA> <NA> +#> 500 <NA> <NA> +#> [ reached 'max' / getOption("max.print") -- omitted 1500 rows ]# select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB' example_isolates[, c("mo", aminoglycosides())] - +#> ℹ For `aminoglycosides()` using columns: 'AMK' (amikacin), 'GEN' +#> KAN' (kanamycin) and 'TOB' (tobramycin)#> mo GEN TOB AMK KAN +#> 1 B_ESCHR_COLI <NA> <NA> <NA> <NA> +#> 2 B_ESCHR_COLI <NA> <NA> <NA> <NA> +#> 3 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 4 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 5 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 6 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 7 B_STPHY_AURS <NA> S <NA> <NA> +#> 8 B_STPHY_AURS <NA> S <NA> <NA> +#> 9 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 10 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 11 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 12 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 13 B_ESCHR_COLI <NA> S <NA> <NA> +#> 14 B_ESCHR_COLI <NA> S <NA> <NA> +#> 15 B_CTRBC_FRND <NA> <NA> <NA> <NA> +#> 16 B_PROTS_MRBL <NA> <NA> <NA> <NA> +#> 17 B_PROTS_MRBL <NA> <NA> <NA> <NA> +#> 18 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 19 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 20 B_STPHY_CONS <NA> <NA> <NA> <NA> +#> 21 B_STPHY_HMNS <NA> <NA> <NA> <NA> +#> 22 B_SERRT_MRCS <NA> <NA> <NA> <NA> +#> 23 B_SERRT_MRCS <NA> <NA> <NA> <NA> +#> 24 B_SERRT_MRCS <NA> <NA> <NA> <NA> +#> 25 B_STPHY_CONS <NA> <NA> <NA> <NA> +#> 26 B_STPHY_CONS <NA> S <NA> <NA> +#> 27 B_STPHY_EPDR <NA> <NA> <NA> <NA> +#> 28 B_ENTRC_FACM R R R R +#> 29 B_STPHY_CONS S <NA> <NA> <NA> +#> 30 B_STPHY_CONS S <NA> <NA> <NA> +#> 31 B_STPHY_HMNS S <NA> <NA> <NA> +#> 32 B_STPHY_EPDR S <NA> <NA> <NA> +#> 33 B_KLBSL_PNMN S S <NA> <NA> +#> 34 B_KLBSL_PNMN S S <NA> <NA> +#> 35 B_ESCHR_COLI S <NA> <NA> <NA> +#> 36 B_PSDMN_AERG I S <NA> R +#> 37 B_STPHY_CONS R R R R +#> 38 B_ESCHR_COLI S S <NA> <NA> +#> 39 B_ESCHR_COLI S S <NA> <NA> +#> 40 B_STRPT_SNGN R R R R +#> 41 B_STPHY_AURS S <NA> <NA> <NA> +#> 42 B_STPHY_AURS S <NA> <NA> <NA> +#> 43 B_STPHY_AURS S <NA> <NA> <NA> +#> 44 B_STPHY_AURS S <NA> <NA> <NA> +#> 45 B_ENTRC_FCLS R R R R +#> 46 B_STPHY_CONS S <NA> <NA> <NA> +#> 47 F_CANDD_GLBR <NA> <NA> <NA> <NA> +#> 48 B_STRPT_GRPB R R R R +#> 49 B_ESCHR_COLI S S <NA> <NA> +#> 50 B_ESCHR_COLI S S <NA> <NA> +#> 51 B_KLBSL_PNMN S S <NA> <NA> +#> 52 B_STPHY_AURS S <NA> <NA> <NA> +#> 53 B_STPHY_CONS R R R R +#> 54 B_STPHY_CONS R R R R +#> 55 B_STRPT_PNMN R R R R +#> 56 B_STRPT_PNMN R R R R +#> 57 B_STPHY_AURS S <NA> <NA> <NA> +#> 58 B_STRPT_ANGN R R R R +#> 59 B_STRPT_ANGN R R R R +#> 60 B_STPHY_AURS S <NA> <NA> <NA> +#> 61 B_STPHY_AURS S <NA> <NA> <NA> +#> 62 B_STPHY_EPDR R R R R +#> 63 B_STPHY_AURS S <NA> <NA> <NA> +#> 64 B_STRPT_PNMN R R R R +#> 65 B_ESCHR_COLI S S <NA> <NA> +#> 66 B_ESCHR_COLI S S <NA> <NA> +#> 67 B_ESCHR_COLI S S <NA> <NA> +#> 68 B_STPHY_CONS S <NA> <NA> <NA> +#> 69 B_CRYNB <NA> <NA> <NA> <NA> +#> 70 B_STPHY_HMNS S <NA> <NA> <NA> +#> 71 B_ESCHR_COLI S S <NA> <NA> +#> 72 B_ESCHR_COLI S S <NA> <NA> +#> 73 B_ENTRC_FCLS R R R R +#> 74 B_ENTRC_FCLS R R R R +#> 75 B_STPHY_HMNS I <NA> <NA> <NA> +#> 76 B_ESCHR_COLI S S <NA> <NA> +#> 77 B_STPHY_CONS S <NA> <NA> <NA> +#> 78 B_PSDMN_AERG I S <NA> R +#> 79 B_PSDMN_AERG I S <NA> R +#> 80 B_STPHY_AURS S <NA> <NA> <NA> +#> 81 B_STPHY_AURS S <NA> <NA> <NA> +#> 82 B_STPHY_AURS S <NA> <NA> <NA> +#> 83 B_STPHY_CONS S <NA> <NA> <NA> +#> 84 B_ESCHR_COLI S S <NA> <NA> +#> 85 B_ESCHR_COLI S S <NA> <NA> +#> 86 B_ESCHR_COLI S S <NA> <NA> +#> 87 B_ESCHR_COLI S S <NA> <NA> +#> 88 B_ESCHR_COLI S S <NA> <NA> +#> 89 B_ESCHR_COLI S S <NA> <NA> +#> 90 B_STRPT_SLVR R R R R +#> 91 B_STRPT_SLVR R R R R +#> 92 B_STPHY_AURS S <NA> <NA> <NA> +#> 93 B_STPHY_CONS S <NA> <NA> <NA> +#> 94 B_STPHY_AURS S <NA> <NA> <NA> +#> 95 B_STPHY_AURS S <NA> <NA> <NA> +#> 96 B_CMPYL_JEJN <NA> <NA> <NA> <NA> +#> 97 B_STPHY_EPDR S S <NA> <NA> +#> 98 B_MCRCCC S R <NA> <NA> +#> 99 B_STPHY_EPDR S <NA> <NA> <NA> +#> 100 B_STRPT_PNMN R R R R +#> 101 B_ACNTB S S <NA> <NA> +#> 102 B_STPHY_AURS S <NA> <NA> <NA> +#> 103 B_STPHY_AURS S <NA> <NA> <NA> +#> 104 B_STPHY_AURS S <NA> <NA> <NA> +#> 105 B_STPHY_AURS S <NA> <NA> <NA> +#> 106 B_STPHY_AURS S <NA> <NA> <NA> +#> 107 B_STPHY_AURS S <NA> <NA> <NA> +#> 108 B_STPHY_EPDR R R R R +#> 109 B_STRPT_PNMN R R R R +#> 110 B_STRPT_PNMN R R R R +#> 111 B_STPHY_CONS R R R R +#> 112 B_STPHY_CONS S <NA> <NA> <NA> +#> 113 B_STPHY_CONS S <NA> <NA> <NA> +#> 114 B_STPHY_CONS S <NA> <NA> <NA> +#> 115 B_STPHY_HMNS S <NA> <NA> <NA> +#> 116 B_PROTS_MRBL S S <NA> <NA> +#> 117 B_BCTRD_FRGL <NA> <NA> <NA> <NA> +#> 118 B_PROTS_MRBL S S <NA> <NA> +#> 119 B_ESCHR_COLI S S <NA> <NA> +#> 120 B_ESCHR_COLI S S <NA> <NA> +#> 121 B_ESCHR_COLI S S <NA> <NA> +#> 122 B_ESCHR_COLI S S <NA> <NA> +#> 123 B_STPHY_EPDR R R R R +#> 124 B_STPHY_EPDR R R R R +#> 125 B_STPHY_CONS R R R R +#> 126 B_STPHY_AURS S <NA> <NA> <NA> +#> 127 B_STPHY_CONS S <NA> <NA> <NA> +#> 128 B_STPHY_CONS S <NA> <NA> <NA> +#> 129 B_ESCHR_COLI S S <NA> <NA> +#> 130 B_ESCHR_COLI S S <NA> <NA> +#> 131 B_STPHY_AURS S <NA> <NA> <NA> +#> 132 B_STPHY_AURS S <NA> <NA> <NA> +#> 133 B_STPHY_CONS S <NA> <NA> <NA> +#> 134 B_STRPT_PNMN R R R R +#> 135 B_CRYNB <NA> <NA> <NA> <NA> +#> 136 B_STRPT_PNMN R R R R +#> 137 B_STPHY_CONS S <NA> <NA> <NA> +#> 138 B_STPHY_CONS S <NA> <NA> <NA> +#> 139 B_ESCHR_COLI S S <NA> <NA> +#> 140 B_STPHY_HMNS R R R R +#> 141 B_STPHY_CONS R R R R +#> 142 B_STPHY_EPDR S <NA> <NA> <NA> +#> 143 B_ESCHR_COLI S S <NA> <NA> +#> 144 B_STPHY_AURS S <NA> <NA> <NA> +#> 145 B_STPHY_CONS R R R R +#> 146 B_STPHY_CONS R R R R +#> 147 B_STRPT_PNMN R R R R +#> 148 B_STRPT_PNMN R R R R +#> 149 B_STRPT_PNMN R R R R +#> 150 B_STRPT_PNMN R R R R +#> 151 B_STPHY_AURS S <NA> <NA> <NA> +#> 152 B_STPHY_AURS S <NA> <NA> <NA> +#> 153 B_STRPT_PYGN R R R R +#> 154 B_STRPT_GRPA R R R R +#> 155 B_STRPT_GRPA R R R R +#> 156 B_STPHY_CONS S <NA> <NA> <NA> +#> 157 B_STPHY_CONS S <NA> <NA> <NA> +#> 158 B_STPHY_AURS S <NA> <NA> <NA> +#> 159 B_STPHY_AURS S <NA> <NA> <NA> +#> 160 B_ENTRC <NA> <NA> <NA> <NA> +#> 161 B_STPHY_CONS R R R R +#> 162 B_ENTRC <NA> <NA> <NA> <NA> +#> 163 B_STPHY_CONS R R R R +#> 164 B_STPHY_CONS I <NA> <NA> <NA> +#> 165 B_STPHY_CONS I <NA> <NA> <NA> +#> 166 B_STPHY_CONS R R R R +#> 167 B_CRYNB <NA> <NA> <NA> <NA> +#> 168 B_STPHY_EPDR R R R R +#> 169 B_STPHY_EPDR S <NA> <NA> <NA> +#> 170 B_STPHY_CONS S <NA> <NA> <NA> +#> 171 B_STPHY_HMNS S <NA> <NA> <NA> +#> 172 B_STPHY_CONS S <NA> <NA> <NA> +#> 173 B_HMPHL_PRNF <NA> <NA> <NA> <NA> +#> 174 B_STPHY_AURS S <NA> <NA> <NA> +#> 175 B_STPHY_AURS S <NA> <NA> <NA> +#> 176 B_ESCHR_COLI S S <NA> <NA> +#> 177 B_STRPT_PNMN R R R R +#> 178 B_STPHY_AURS S <NA> <NA> <NA> +#> 179 B_STRPT_MITS R R R R +#> 180 B_STRPT_MITS R R R R +#> 181 B_STPHY_CONS S <NA> <NA> <NA> +#> 182 B_STPHY_CONS S <NA> <NA> <NA> +#> 183 B_ESCHR_COLI S S <NA> <NA> +#> 184 B_ESCHR_COLI S S <NA> <NA> +#> 185 B_STPHY_EPDR S <NA> <NA> <NA> +#> 186 B_STPHY_CONS S <NA> <NA> <NA> +#> 187 B_STPHY_CONS R R R R +#> 188 B_STPHY_CONS S <NA> <NA> <NA> +#> 189 B_STPHY_EPDR S <NA> <NA> <NA> +#> 190 B_STPHY_EPDR R R R R +#> 191 B_STPHY_AURS S <NA> <NA> <NA> +#> 192 B_STPHY_CONS S <NA> <NA> <NA> +#> 193 B_STRPT_PNMN R R R R +#> 194 B_KLBSL_PNMN S S <NA> <NA> +#> 195 B_KLBSL_PNMN S S <NA> <NA> +#> 196 B_STPHY_CONS S <NA> <NA> <NA> +#> 197 B_STPHY_CONS S <NA> <NA> <NA> +#> 198 B_STPHY_CONS S <NA> <NA> <NA> +#> 199 B_ESCHR_COLI S S <NA> <NA> +#> 200 B_STPHY_AURS S <NA> <NA> <NA> +#> [ reached 'max' / getOption("max.print") -- omitted 1800 rows ]# filter using any() or all() example_isolates[any(carbapenems() == "R"), ] -subset(example_isolates, any(carbapenems() == "R")) - +#> ℹ Assuming a filter on all 2 carbapenems. Wrap around `all()` or `any()` to +#>#> date hospital_id ward_icu ward_clinical ward_outpatient age gender +#> 381 2004-11-03 B TRUE FALSE FALSE 80 F +#> 461 2005-04-21 B TRUE FALSE FALSE 82 F +#> 462 2005-04-22 B TRUE FALSE FALSE 82 F +#> 463 2005-04-22 B TRUE FALSE FALSE 82 F +#> 698 2007-02-21 D FALSE TRUE FALSE 61 F +#> 799 2007-12-15 A FALSE TRUE FALSE 72 M +#> 918 2008-12-06 D FALSE TRUE FALSE 43 F +#> 1147 2011-03-16 B TRUE TRUE FALSE 83 M +#> 1149 2011-03-19 B TRUE TRUE FALSE 83 M +#> 1156 2011-04-06 D TRUE TRUE FALSE 74 M +#> 1157 2011-04-11 C FALSE TRUE FALSE 74 M +#> 1172 2011-05-09 D TRUE TRUE FALSE 82 F +#> 1210 2011-08-01 D FALSE TRUE FALSE 63 M +#> 1213 2011-08-18 B FALSE TRUE FALSE 75 F +#> 1217 2011-09-01 B FALSE TRUE FALSE 71 M +#> 1218 2011-09-01 B FALSE TRUE FALSE 71 M +#> 1242 2011-11-04 D FALSE TRUE FALSE 70 M +#> 1243 2011-11-07 D FALSE TRUE FALSE 70 M +#> 1246 2011-11-10 D FALSE TRUE FALSE 90 F +#> 1259 2012-02-06 D TRUE TRUE FALSE 80 M +#> patient_id mo PEN OXA FLC AMX AMC AMP TZP CZO FEP CXM +#> 381 D65308 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R +#> 461 452212 B_ENTRC <NA> <NA> <NA> <NA> <NA> <NA> R <NA> <NA> <NA> +#> 462 452212 B_ENTRC <NA> <NA> <NA> <NA> <NA> <NA> R <NA> <NA> <NA> +#> 463 452212 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 698 8BBC46 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 799 401043 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 918 501361 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R +#> 1147 0D7D34 B_STPHY_EPDR R R R R R R R R R R +#> 1149 0D7D34 B_STPHY_EPDR R R R R R R R R R R +#> 1156 329273 B_STPHY_CONS R R R R R R R R R R +#> 1157 A26784 B_STPHY_CONS R R R R R R R R R R +#> 1172 207325 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 1210 F8DB34 B_STPHY_CONS R R R R R R R R R R +#> 1213 A81782 B_STPHY_CONS R R R R R R R R R R +#> 1217 50C8DB B_STPHY_EPDR R R R R R R R R R R +#> 1218 50C8DB B_STPHY_CONS R R R R R R R R R R +#> 1242 443847 B_STPHY_CONS R R R R R R R R R R +#> 1243 116866 B_STPHY_CONS R R R R R R R R R R +#> 1246 F86227 B_STPHY_CONS R R R R R R R R R R +#> 1259 967247 B_STPHY_CONS R R R R R R R R R R +#> FOX CTX CAZ CRO GEN TOB AMK KAN TMP SXT NIT FOS LNZ CIP MFX +#> 381 R R R R R R R R R S <NA> R R <NA> <NA> +#> 461 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> +#> 462 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> +#> 463 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 698 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 799 R R R R R R R R R R <NA> <NA> <NA> R <NA> +#> 918 R R R R R R R R R S R R R S <NA> +#> 1147 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1149 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1156 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1157 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> I <NA> +#> 1172 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 1210 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1213 R R R R S <NA> <NA> <NA> R <NA> <NA> <NA> <NA> R <NA> +#> 1217 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1218 R R R R S <NA> <NA> <NA> S S <NA> <NA> <NA> S <NA> +#> 1242 R R R R S <NA> <NA> <NA> S S <NA> <NA> <NA> S <NA> +#> 1243 R R R R S <NA> <NA> <NA> R S <NA> <NA> <NA> R <NA> +#> 1246 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1259 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> VAN TEC TCY TGC DOX ERY CLI AZM IPM MEM MTR CHL COL MUP RIF +#> 381 R R R <NA> R R R R R R <NA> <NA> R <NA> R +#> 461 S <NA> R <NA> <NA> R <NA> R R R <NA> <NA> R <NA> <NA> +#> 462 S <NA> R <NA> <NA> R <NA> R R R <NA> <NA> R <NA> <NA> +#> 463 S <NA> R <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 698 S <NA> S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 799 S <NA> S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 918 R R R <NA> R R R R R R <NA> <NA> R <NA> R +#> 1147 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1149 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1156 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1157 S <NA> <NA> <NA> S R S R R R <NA> <NA> R <NA> <NA> +#> 1172 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1210 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1213 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1217 S <NA> <NA> <NA> S S S S R R <NA> <NA> R <NA> S +#> 1218 S <NA> <NA> <NA> S R S R R R <NA> <NA> R <NA> S +#> 1242 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1243 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1246 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1259 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> [ reached 'max' / getOption("max.print") -- omitted 29 rows ]#> ℹ Assuming a filter on all 2 carbapenems. Wrap around `all()` or `any()` to +#>#> date hospital_id ward_icu ward_clinical ward_outpatient age gender +#> 381 2004-11-03 B TRUE FALSE FALSE 80 F +#> 461 2005-04-21 B TRUE FALSE FALSE 82 F +#> 462 2005-04-22 B TRUE FALSE FALSE 82 F +#> 463 2005-04-22 B TRUE FALSE FALSE 82 F +#> 698 2007-02-21 D FALSE TRUE FALSE 61 F +#> 799 2007-12-15 A FALSE TRUE FALSE 72 M +#> 918 2008-12-06 D FALSE TRUE FALSE 43 F +#> 1147 2011-03-16 B TRUE TRUE FALSE 83 M +#> 1149 2011-03-19 B TRUE TRUE FALSE 83 M +#> 1156 2011-04-06 D TRUE TRUE FALSE 74 M +#> 1157 2011-04-11 C FALSE TRUE FALSE 74 M +#> 1172 2011-05-09 D TRUE TRUE FALSE 82 F +#> 1210 2011-08-01 D FALSE TRUE FALSE 63 M +#> 1213 2011-08-18 B FALSE TRUE FALSE 75 F +#> 1217 2011-09-01 B FALSE TRUE FALSE 71 M +#> 1218 2011-09-01 B FALSE TRUE FALSE 71 M +#> 1242 2011-11-04 D FALSE TRUE FALSE 70 M +#> 1243 2011-11-07 D FALSE TRUE FALSE 70 M +#> 1246 2011-11-10 D FALSE TRUE FALSE 90 F +#> 1259 2012-02-06 D TRUE TRUE FALSE 80 M +#> patient_id mo PEN OXA FLC AMX AMC AMP TZP CZO FEP CXM +#> 381 D65308 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R +#> 461 452212 B_ENTRC <NA> <NA> <NA> <NA> <NA> <NA> R <NA> <NA> <NA> +#> 462 452212 B_ENTRC <NA> <NA> <NA> <NA> <NA> <NA> R <NA> <NA> <NA> +#> 463 452212 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 698 8BBC46 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 799 401043 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 918 501361 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R +#> 1147 0D7D34 B_STPHY_EPDR R R R R R R R R R R +#> 1149 0D7D34 B_STPHY_EPDR R R R R R R R R R R +#> 1156 329273 B_STPHY_CONS R R R R R R R R R R +#> 1157 A26784 B_STPHY_CONS R R R R R R R R R R +#> 1172 207325 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R +#> 1210 F8DB34 B_STPHY_CONS R R R R R R R R R R +#> 1213 A81782 B_STPHY_CONS R R R R R R R R R R +#> 1217 50C8DB B_STPHY_EPDR R R R R R R R R R R +#> 1218 50C8DB B_STPHY_CONS R R R R R R R R R R +#> 1242 443847 B_STPHY_CONS R R R R R R R R R R +#> 1243 116866 B_STPHY_CONS R R R R R R R R R R +#> 1246 F86227 B_STPHY_CONS R R R R R R R R R R +#> 1259 967247 B_STPHY_CONS R R R R R R R R R R +#> FOX CTX CAZ CRO GEN TOB AMK KAN TMP SXT NIT FOS LNZ CIP MFX +#> 381 R R R R R R R R R S <NA> R R <NA> <NA> +#> 461 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> +#> 462 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> +#> 463 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 698 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 799 R R R R R R R R R R <NA> <NA> <NA> R <NA> +#> 918 R R R R R R R R R S R R R S <NA> +#> 1147 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1149 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1156 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1157 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> I <NA> +#> 1172 R R R R R R R R R R <NA> <NA> <NA> <NA> <NA> +#> 1210 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1213 R R R R S <NA> <NA> <NA> R <NA> <NA> <NA> <NA> R <NA> +#> 1217 R R R R I <NA> <NA> <NA> R <NA> <NA> <NA> <NA> S <NA> +#> 1218 R R R R S <NA> <NA> <NA> S S <NA> <NA> <NA> S <NA> +#> 1242 R R R R S <NA> <NA> <NA> S S <NA> <NA> <NA> S <NA> +#> 1243 R R R R S <NA> <NA> <NA> R S <NA> <NA> <NA> R <NA> +#> 1246 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> 1259 R R R R S <NA> <NA> <NA> R R <NA> <NA> <NA> R <NA> +#> VAN TEC TCY TGC DOX ERY CLI AZM IPM MEM MTR CHL COL MUP RIF +#> 381 R R R <NA> R R R R R R <NA> <NA> R <NA> R +#> 461 S <NA> R <NA> <NA> R <NA> R R R <NA> <NA> R <NA> <NA> +#> 462 S <NA> R <NA> <NA> R <NA> R R R <NA> <NA> R <NA> <NA> +#> 463 S <NA> R <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 698 S <NA> S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 799 S <NA> S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 918 R R R <NA> R R R R R R <NA> <NA> R <NA> R +#> 1147 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1149 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1156 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1157 S <NA> <NA> <NA> S R S R R R <NA> <NA> R <NA> <NA> +#> 1172 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1210 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1213 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1217 S <NA> <NA> <NA> S S S S R R <NA> <NA> R <NA> S +#> 1218 S <NA> <NA> <NA> S R S R R R <NA> <NA> R <NA> S +#> 1242 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1243 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1246 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1259 S <NA> <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> [ reached 'max' / getOption("max.print") -- omitted 29 rows ]# filter on any or all results in the carbapenem columns (i.e., IPM, MEM): example_isolates[any(carbapenems()), ] -example_isolates[all(carbapenems()), ] - +#> ℹ Filtering any of columns 'IPM' and 'MEM' to contain value "R", "S" or "I"#> date hospital_id ward_icu ward_clinical ward_outpatient age gender +#> 13 2002-01-19 D FALSE TRUE FALSE 71 M +#> 14 2002-01-19 D FALSE TRUE FALSE 71 M +#> 16 2002-01-22 B TRUE FALSE FALSE 50 M +#> 17 2002-01-22 B TRUE FALSE FALSE 50 M +#> 22 2002-02-05 B TRUE FALSE FALSE 45 F +#> 23 2002-02-05 B TRUE FALSE FALSE 45 F +#> 24 2002-02-05 B TRUE FALSE FALSE 45 F +#> 33 2002-02-27 D FALSE TRUE FALSE 85 F +#> 34 2002-02-27 D FALSE TRUE FALSE 85 F +#> 35 2002-03-08 C FALSE TRUE FALSE 69 M +#> 36 2002-03-16 C FALSE TRUE FALSE 69 M +#> 38 2002-04-01 B TRUE FALSE FALSE 46 F +#> 39 2002-04-01 B TRUE FALSE FALSE 46 F +#> 45 2002-04-08 A TRUE TRUE FALSE 78 M +#> 48 2002-04-14 C FALSE FALSE TRUE 73 M +#> 49 2002-04-23 B TRUE FALSE FALSE 69 F +#> 50 2002-04-23 B TRUE FALSE FALSE 69 F +#> 51 2002-04-26 D FALSE TRUE FALSE 79 M +#> 65 2002-06-05 D FALSE TRUE FALSE 20 F +#> 66 2002-06-06 D FALSE TRUE FALSE 20 F +#> patient_id mo PEN OXA FLC AMX AMC AMP TZP CZO FEP CXM FOX +#> 13 738003 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> 14 738003 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> 16 F35553 B_PROTS_MRBL R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> 17 F35553 B_PROTS_MRBL R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> 22 067927 B_SERRT_MRCS R <NA> <NA> R R R <NA> R <NA> R R +#> 23 067927 B_SERRT_MRCS R <NA> <NA> R R R <NA> R <NA> R R +#> 24 067927 B_SERRT_MRCS R <NA> <NA> R R R <NA> R <NA> R R +#> 33 066895 B_KLBSL_PNMN R <NA> <NA> R I R <NA> <NA> <NA> S <NA> +#> 34 066895 B_KLBSL_PNMN R <NA> <NA> R I R <NA> <NA> <NA> S <NA> +#> 35 4FC193 B_ESCHR_COLI R <NA> <NA> R R R <NA> <NA> <NA> R <NA> +#> 36 4FC193 B_PSDMN_AERG R <NA> <NA> R R R <NA> R <NA> R R +#> 38 496896 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> I <NA> +#> 39 496896 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> I <NA> +#> 45 130252 B_ENTRC_FCLS <NA> <NA> <NA> <NA> S <NA> <NA> R R R R +#> 48 F30196 B_STRPT_GRPB S <NA> S S S S S S S S S +#> 49 EE2510 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> R <NA> <NA> I <NA> +#> 50 EE2510 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> R <NA> <NA> I <NA> +#> 51 D10443 B_KLBSL_PNMN R <NA> <NA> R S R <NA> <NA> <NA> S <NA> +#> 65 24D393 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> 66 24D393 B_ESCHR_COLI R <NA> <NA> <NA> I <NA> <NA> <NA> <NA> S <NA> +#> CTX CAZ CRO GEN TOB AMK KAN TMP SXT NIT FOS LNZ CIP MFX VAN TEC +#> 13 S <NA> S <NA> S <NA> <NA> S S <NA> <NA> R <NA> <NA> R R +#> 14 S <NA> S <NA> S <NA> <NA> S S <NA> <NA> R <NA> <NA> R R +#> 16 S S S <NA> <NA> <NA> <NA> S S R <NA> R S <NA> R R +#> 17 S S S <NA> <NA> <NA> <NA> S S R <NA> R S <NA> R R +#> 22 <NA> <NA> <NA> <NA> <NA> <NA> <NA> S S R <NA> R S <NA> R R +#> 23 <NA> <NA> <NA> <NA> <NA> <NA> <NA> S S R <NA> R S <NA> R R +#> 24 <NA> <NA> <NA> <NA> <NA> <NA> <NA> S S R <NA> R S <NA> R R +#> 33 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 34 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 35 S S S S <NA> <NA> <NA> S S <NA> <NA> R S <NA> R R +#> 36 R R R I S <NA> R R R <NA> <NA> R I <NA> R R +#> 38 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 39 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 45 R R R R R R R R R <NA> <NA> <NA> <NA> <NA> S <NA> +#> 48 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 49 S S S S S <NA> <NA> R R R <NA> R R R R R +#> 50 S S S S S <NA> <NA> R R R <NA> R R R R R +#> 51 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 65 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> 66 S S S S S <NA> <NA> S S S <NA> R S <NA> R R +#> TCY TGC DOX ERY CLI AZM IPM MEM MTR CHL COL MUP RIF +#> 13 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 14 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 16 R R R R R R S <NA> <NA> <NA> R <NA> R +#> 17 R R R R R R S <NA> <NA> <NA> R <NA> R +#> 22 R R R R R R S <NA> <NA> <NA> R <NA> R +#> 23 R R R R R R S <NA> <NA> <NA> R <NA> R +#> 24 R R R R R R S <NA> <NA> <NA> R <NA> R +#> 33 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 34 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 35 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 36 R R R R R R S <NA> <NA> R <NA> <NA> R +#> 38 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 39 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 45 R <NA> <NA> R R R S <NA> <NA> <NA> R <NA> <NA> +#> 48 S <NA> S S <NA> S S S <NA> <NA> R <NA> <NA> +#> 49 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 50 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 51 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 65 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> 66 <NA> <NA> <NA> R R R S <NA> <NA> <NA> <NA> <NA> R +#> [ reached 'max' / getOption("max.print") -- omitted 942 rows ]#> ℹ Filtering all of columns 'IPM' and 'MEM' to contain value "R", "S" or "I"#> date hospital_id ward_icu ward_clinical ward_outpatient age gender +#> 48 2002-04-14 C FALSE FALSE TRUE 73 M +#> 153 2003-04-08 B TRUE FALSE FALSE 74 M +#> 154 2003-04-08 B TRUE FALSE FALSE 74 M +#> 155 2003-04-08 B TRUE FALSE FALSE 74 M +#> 207 2003-08-14 D FALSE TRUE FALSE 0 F +#> 237 2003-10-16 B TRUE FALSE FALSE 63 F +#> 240 2003-10-20 B TRUE FALSE FALSE 52 M +#> 242 2003-10-20 B TRUE FALSE FALSE 52 M +#> 246 2003-11-04 B TRUE FALSE FALSE 87 F +#> 247 2003-11-04 B TRUE FALSE FALSE 87 F +#> 248 2003-11-04 B TRUE FALSE FALSE 87 F +#> 251 2003-11-21 B TRUE FALSE FALSE 77 F +#> 278 2004-02-10 B TRUE FALSE FALSE 71 F +#> 279 2004-02-10 B TRUE FALSE FALSE 71 F +#> 280 2004-02-10 B TRUE FALSE FALSE 71 F +#> 298 2004-03-03 D FALSE TRUE FALSE 74 M +#> 299 2004-03-03 D FALSE TRUE FALSE 74 M +#> 309 2004-04-07 C FALSE TRUE FALSE 86 F +#> 313 2004-04-15 B TRUE FALSE FALSE 87 F +#> 314 2004-04-15 B TRUE FALSE FALSE 87 F +#> patient_id mo PEN OXA FLC AMX AMC AMP TZP CZO FEP CXM FOX +#> 48 F30196 B_STRPT_GRPB S <NA> S S S S S S S S S +#> 153 114570 B_STRPT_PYGN S <NA> S S S S S S S S S +#> 154 114570 B_STRPT_GRPA S <NA> S S S S S S S S S +#> 155 114570 B_STRPT_GRPA S <NA> S S S S S S S S S +#> 207 F71508 B_STRPT_GRPB S <NA> S S S S S S S S S +#> 237 650870 B_ESCHR_COLI R <NA> <NA> R R R S <NA> S S S +#> 240 F35553 B_ENTRBC_CLOC R <NA> <NA> R R R S R S R R +#> 242 F35553 B_ENTRBC_CLOC R <NA> <NA> R R R S R S R R +#> 246 2FC253 B_ESCHR_COLI R <NA> <NA> <NA> S <NA> S <NA> S S S +#> 247 2FC253 B_ESCHR_COLI R <NA> <NA> <NA> S <NA> S <NA> S S S +#> 248 2FC253 B_ESCHR_COLI R <NA> <NA> <NA> S <NA> S <NA> S S S +#> 251 550406 B_ESCHR_COLI R <NA> <NA> R R R S <NA> S I R +#> 278 F24801 B_STRPT_GRPB S <NA> S S S S S S S S S +#> 279 F24801 B_STRPT_AGLC S <NA> S S S S S S S S S +#> 280 F24801 B_STRPT_GRPB S <NA> S S S S S S S S S +#> 298 1435C8 B_ESCHR_COLI R <NA> <NA> S S S S <NA> S S S +#> 299 1435C8 B_ESCHR_COLI R <NA> <NA> S S S S <NA> S S S +#> 309 765860 B_STRPT_GRPA S <NA> S S S S S S S S S +#> 313 386739 B_ESCHR_COLI R <NA> <NA> R I R S <NA> S S S +#> 314 386739 B_ESCHR_COLI R <NA> <NA> R I R S <NA> S S S +#> CTX CAZ CRO GEN TOB AMK KAN TMP SXT NIT FOS LNZ CIP MFX VAN TEC +#> 48 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 153 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 154 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 155 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 207 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 237 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 240 <NA> <NA> <NA> S S S <NA> <NA> S R <NA> R S <NA> R R +#> 242 <NA> <NA> <NA> S S S <NA> <NA> S R <NA> R S <NA> R R +#> 246 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 247 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 248 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 251 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 278 S R S R R R R R <NA> <NA> <NA> <NA> <NA> <NA> S <NA> +#> 279 S R S R R R R R <NA> <NA> <NA> <NA> <NA> <NA> S <NA> +#> 280 S R S R R R R R <NA> <NA> <NA> <NA> <NA> <NA> S <NA> +#> 298 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 299 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 309 S R S R R R R S S <NA> <NA> <NA> <NA> <NA> S <NA> +#> 313 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> 314 S S S S S S <NA> <NA> S S <NA> R S <NA> R R +#> TCY TGC DOX ERY CLI AZM IPM MEM MTR CHL COL MUP RIF +#> 48 S <NA> S S <NA> S S S <NA> <NA> R <NA> <NA> +#> 153 S <NA> S S S S S S <NA> <NA> R <NA> <NA> +#> 154 S <NA> S S S S S S <NA> <NA> R <NA> <NA> +#> 155 S <NA> S S S S S S <NA> <NA> R <NA> <NA> +#> 207 R <NA> <NA> S <NA> S S S <NA> <NA> R <NA> <NA> +#> 237 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 240 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 242 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 246 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 247 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 248 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 251 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 278 R <NA> <NA> S <NA> S S S <NA> <NA> R <NA> <NA> +#> 279 R <NA> <NA> S <NA> S S S <NA> <NA> R <NA> <NA> +#> 280 R <NA> <NA> S <NA> S S S <NA> <NA> R <NA> <NA> +#> 298 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 299 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 309 R <NA> <NA> S S S S S <NA> <NA> R <NA> <NA> +#> 313 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> 314 <NA> <NA> <NA> R R R S S <NA> <NA> <NA> <NA> R +#> [ reached 'max' / getOption("max.print") -- omitted 736 rows ]# filter with multiple antibiotic selectors using c() example_isolates[all(c(carbapenems(), aminoglycosides()) == "R"), ] - +#> ℹ Assuming a filter on all 6 carbapenems, aminoglycosides. Wrap around +#> `all()` or `any()` to prevent this note.#> date hospital_id ward_icu ward_clinical ward_outpatient age gender +#> 381 2004-11-03 B TRUE FALSE FALSE 80 F +#> 463 2005-04-22 B TRUE FALSE FALSE 82 F +#> 698 2007-02-21 D FALSE TRUE FALSE 61 F +#> 799 2007-12-15 A FALSE TRUE FALSE 72 M +#> 918 2008-12-06 D FALSE TRUE FALSE 43 F +#> 1172 2011-05-09 D TRUE TRUE FALSE 82 F +#> 1262 2012-03-12 B TRUE TRUE FALSE 80 M +#> 1281 2012-05-19 A FALSE FALSE TRUE 89 F +#> 1302 2012-07-17 D TRUE TRUE FALSE 83 M +#> 1307 2012-07-20 D FALSE TRUE FALSE 66 F +#> 1308 2012-07-20 D FALSE TRUE FALSE 66 F +#> 1324 2012-09-18 D FALSE TRUE FALSE 62 M +#> 1328 2012-10-04 D FALSE TRUE FALSE 62 M +#> 1334 2012-10-18 D TRUE TRUE FALSE 65 F +#> 1449 2014-01-14 B FALSE TRUE FALSE 81 M +#> 1450 2014-01-14 B FALSE TRUE FALSE 81 M +#> 1624 2015-10-06 B TRUE TRUE FALSE 79 F +#> 1625 2015-10-07 B TRUE TRUE FALSE 79 F +#> 1626 2015-10-07 B TRUE TRUE FALSE 79 F +#> 1690 2016-03-27 D FALSE TRUE FALSE 47 M +#> patient_id mo PEN OXA FLC AMX AMC AMP TZP CZO FEP CXM FOX +#> 381 D65308 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R R +#> 463 452212 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R R +#> 698 8BBC46 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R R +#> 799 401043 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R R +#> 918 501361 B_STNTR_MLTP R <NA> <NA> R R R R R <NA> R R +#> 1172 207325 B_ENTRC_FACM <NA> <NA> <NA> <NA> <NA> <NA> R R R R R +#> 1262 582258 B_STPHY_CONS R R R R R R R R R R R +#> 1281 C25552 B_STPHY_CONS R R R R R R R R R R R +#> 1302 F05015 B_STPHY_CONS R R R R R R R R R R R +#> 1307 404299 B_STPHY_CONS R R R R R R R R R R R +#> 1308 404299 B_STPHY_CONS R R R R R R R R R R R +#> 1324 431647 B_STPHY_CONS R R R R R R R R R R R +#> 1328 431647 B_STPHY_CONS R R R R R R R R R R R +#> 1334 E4F322 B_ENTRC_FACM R R R R R R R R R R R +#> 1449 8F77B2 B_ENTRC_FACM R R R R R R R R R R R +#> 1450 8F77B2 B_ENTRC_FACM R R R R R R R R R R R +#> 1624 A76045 B_ENTRC_FACM R R R R R R R R R R R +#> 1625 A76045 B_ENTRC_FACM R R R R R R R R R R R +#> 1626 A76045 B_ENTRC_FACM R R R R R R R R R R R +#> 1690 960787 B_ENTRC_FACM R R R R R R R R R R R +#> CTX CAZ CRO GEN TOB AMK KAN TMP SXT NIT FOS LNZ CIP MFX VAN TEC +#> 381 R R R R R R R R S <NA> R R <NA> <NA> R R +#> 463 R R R R R R R R R <NA> <NA> <NA> <NA> <NA> S <NA> +#> 698 R R R R R R R R R <NA> <NA> <NA> <NA> <NA> S <NA> +#> 799 R R R R R R R R R <NA> <NA> <NA> R <NA> S <NA> +#> 918 R R R R R R R R S R R R S <NA> R R +#> 1172 R R R R R R R R R <NA> <NA> <NA> <NA> <NA> S <NA> +#> 1262 R R R R R R R R <NA> <NA> <NA> <NA> S <NA> S <NA> +#> 1281 R R R R R R R R R <NA> <NA> <NA> R <NA> S <NA> +#> 1302 R R R R R R R S S <NA> <NA> <NA> S <NA> S <NA> +#> 1307 R R R R R R R R S <NA> <NA> <NA> S <NA> <NA> <NA> +#> 1308 R R R R R R R R R <NA> <NA> <NA> R <NA> S <NA> +#> 1324 R R R R R R R R R <NA> <NA> <NA> R <NA> S <NA> +#> 1328 R R R R R R R R R S <NA> <NA> R <NA> <NA> <NA> +#> 1334 R R R R R R R R R S <NA> S <NA> <NA> S <NA> +#> 1449 R R R R R R R R R S <NA> S <NA> <NA> S S +#> 1450 R R R R R R R R R S <NA> S <NA> <NA> S S +#> 1624 R R R R R R R R R S <NA> S <NA> <NA> S S +#> 1625 R R R R R R R R R S <NA> S <NA> <NA> S S +#> 1626 R R R R R R R R R S <NA> S <NA> <NA> S S +#> 1690 R R R R R R R R R S <NA> S <NA> <NA> S S +#> TCY TGC DOX ERY CLI AZM IPM MEM MTR CHL COL MUP RIF +#> 381 R <NA> R R R R R R <NA> <NA> R <NA> R +#> 463 R <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 698 S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 799 S <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 918 R <NA> R R R R R R <NA> <NA> R <NA> R +#> 1172 <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1262 <NA> <NA> S R R R R R <NA> <NA> R <NA> <NA> +#> 1281 <NA> <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1302 <NA> <NA> R R R R R R <NA> <NA> R <NA> <NA> +#> 1307 <NA> <NA> R R R R R R <NA> <NA> R <NA> <NA> +#> 1308 <NA> <NA> S R S R R R <NA> <NA> R <NA> <NA> +#> 1324 <NA> <NA> R R S R R R <NA> <NA> R <NA> <NA> +#> 1328 R <NA> R R R R R R <NA> <NA> R S S +#> 1334 <NA> <NA> <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1449 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1450 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1624 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1625 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1626 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> 1690 <NA> S <NA> R R R R R <NA> <NA> R <NA> <NA> +#> [ reached 'max' / getOption("max.print") -- omitted 6 rows ]# filter + select in one go: get penicillins in carbapenems-resistant strains example_isolates[any(carbapenems() == "R"), penicillins()] - +#> ℹ For `penicillins()` using columns: 'AMC' (amoxicillin/clavulanic acid), +#> AMP' (ampicillin), 'AMX' (amoxicillin), 'FLC' (flucloxacillin), 'OXA' +#> PEN' (benzylpenicillin) and 'TZP' (piperacillin/tazobactam)#> ℹ Assuming a filter on all 2 carbapenems. Wrap around `all()` or `any()` to +#>#> PEN OXA FLC AMX AMC AMP TZP +#> 381 R <NA> <NA> R R R R +#> 461 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 462 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 463 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 698 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 799 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 918 R <NA> <NA> R R R R +#> 1147 R R R R R R R +#> 1149 R R R R R R R +#> 1156 R R R R R R R +#> 1157 R R R R R R R +#> 1172 <NA> <NA> <NA> <NA> <NA> <NA> R +#> 1210 R R R R R R R +#> 1213 R R R R R R R +#> 1217 R R R R R R R +#> 1218 R R R R R R R +#> 1242 R R R R R R R +#> 1243 R R R R R R R +#> 1246 R R R R R R R +#> 1259 R R R R R R R +#> 1260 R R R R R R R +#> 1262 R R R R R R R +#> 1268 R R R R R R R +#> 1269 R R R R R R R +#> 1281 R R R R R R R +#> 1302 R R R R R R R +#> 1307 R R R R R R R +#> 1308 R R R R R R R +#> 1311 R R R R R R R +#> 1315 R R R R R R R +#> 1321 R R R R R R R +#> 1324 R R R R R R R +#> 1326 R R R R R R R +#> 1328 R R R R R R R +#> 1334 R R R R R R R +#> 1346 <NA> <NA> <NA> R R R R +#> 1449 R R R R R R R +#> 1450 R R R R R R R +#> 1624 R R R R R R R +#> 1625 R R R R R R R +#> 1626 R R R R R R R +#> 1690 R R R R R R R +#> 1693 R R R R R R R +#> 1696 R R R R R R R +#> 1723 R R R R R R R +#> 1906 R R R R R R R +#> 1908 R R R R R R R +#> 1929 R R R R R R R +#> 1945 R R R R R R R# dplyr ------------------------------------------------------------------- # \donttest{ if (require("dplyr")) { + # get AMR for all aminoglycosides e.g., per hospital: + example_isolates %>% + group_by(hospital_id) %>% + summarise(across(aminoglycosides(), resistance)) + # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem): example_isolates %>% select(carbapenems()) @@ -391,8 +1574,8 @@ The lifecycle of this function is stableexample_isolates %>% filter(carbapenems() == "R") example_isolates %>% filter(across(carbapenems(), ~.x == "R")) } -# } - +#> Error:# } +