The output tells you: “given the species distribution in your
@@ -759,58 +759,58 @@ accepts any column or expression:
0-24
F
-
57% (29.7-81.3%)
-
70.8% (45.2-88.9%)
-
66.1% (43-86.8%)
+
57.1% (29.9-82.1%)
+
71% (43.2-89%)
+
65.8% (43.5-86.2%)
0-24
M
-
59.7% (31.2-85.9%)
-
76.1% (57.1-91.7%)
-
59.5% (31.7-85.1%)
+
59.7% (30.7-86.3%)
+
75.8% (54.2-90.9%)
+
59.6% (32.6-85.2%)
25-49
F
-
67.9% (44.6-89.7%)
-
93.8% (87.4-98.1%)
-
87% (70-97%)
+
67.8% (43.6-90.4%)
+
93.8% (87.5-98.1%)
+
87.3% (71.3-96.9%)
25-49
M
-
56.9% (26.6-86.2%)
-
91.1% (82-97.2%)
-
76.5% (51.4-93.5%)
+
56.4% (25.9-85.2%)
+
91.2% (82.2-97.3%)
+
76.4% (51-93.6%)
50-74
F
-
68% (54.1-81.8%)
+
68.3% (54-82.2%)
96.9% (94.6-98.5%)
-
90.3% (82-96.2%)
+
90.2% (82.1-96.2%)
50-74
M
-
67% (56-78.5%)
-
96.7% (94-98.5%)
-
86.7% (77.3-94.5%)
+
66.9% (56.3-78.5%)
+
96.7% (94.1-98.5%)
+
86.7% (77-94.6%)
75+
F
-
73.2% (61.9-84.2%)
-
97.7% (95.9-99%)
-
92.7% (85.6-97.2%)
+
73.2% (62.7-83.4%)
+
97.7% (95.9-98.9%)
+
92.7% (85.5-97.2%)
75+
M
-
74% (63.6-82.6%)
-
97.9% (96-99%)
-
94.7% (89.3-97.9%)
+
73.6% (63.6-82.4%)
+
97.9% (96.1-99.1%)
+
94.6% (89.5-97.7%)
diff --git a/articles/AMR.md b/articles/AMR.md
index 6bf7876ce..e5fc2b5e3 100644
--- a/articles/AMR.md
+++ b/articles/AMR.md
@@ -652,7 +652,7 @@ wisca_result
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
-| 70% (64.4-75.3%) | 93.6% (92.1-95%) | 89.8% (87-92.3%) |
+| 70.1% (64.7-75.8%) | 93.6% (92-95%) | 89.9% (86.8-92.5%) |
The output tells you: *“given the species distribution in your data,
there is an estimated X% probability that this regimen covers the
@@ -679,14 +679,14 @@ wisca_out
| age_group | gender | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|:---|
-| 0-24 | F | 57% (29.7-81.3%) | 70.8% (45.2-88.9%) | 66.1% (43-86.8%) |
-| 0-24 | M | 59.7% (31.2-85.9%) | 76.1% (57.1-91.7%) | 59.5% (31.7-85.1%) |
-| 25-49 | F | 67.9% (44.6-89.7%) | 93.8% (87.4-98.1%) | 87% (70-97%) |
-| 25-49 | M | 56.9% (26.6-86.2%) | 91.1% (82-97.2%) | 76.5% (51.4-93.5%) |
-| 50-74 | F | 68% (54.1-81.8%) | 96.9% (94.6-98.5%) | 90.3% (82-96.2%) |
-| 50-74 | M | 67% (56-78.5%) | 96.7% (94-98.5%) | 86.7% (77.3-94.5%) |
-| 75+ | F | 73.2% (61.9-84.2%) | 97.7% (95.9-99%) | 92.7% (85.6-97.2%) |
-| 75+ | M | 74% (63.6-82.6%) | 97.9% (96-99%) | 94.7% (89.3-97.9%) |
+| 0-24 | F | 57.1% (29.9-82.1%) | 71% (43.2-89%) | 65.8% (43.5-86.2%) |
+| 0-24 | M | 59.7% (30.7-86.3%) | 75.8% (54.2-90.9%) | 59.6% (32.6-85.2%) |
+| 25-49 | F | 67.8% (43.6-90.4%) | 93.8% (87.5-98.1%) | 87.3% (71.3-96.9%) |
+| 25-49 | M | 56.4% (25.9-85.2%) | 91.2% (82.2-97.3%) | 76.4% (51-93.6%) |
+| 50-74 | F | 68.3% (54-82.2%) | 96.9% (94.6-98.5%) | 90.2% (82.1-96.2%) |
+| 50-74 | M | 66.9% (56.3-78.5%) | 96.7% (94.1-98.5%) | 86.7% (77-94.6%) |
+| 75+ | F | 73.2% (62.7-83.4%) | 97.7% (95.9-98.9%) | 92.7% (85.5-97.2%) |
+| 75+ | M | 73.6% (63.6-82.4%) | 97.9% (96.1-99.1%) | 94.6% (89.5-97.7%) |
Keep in mind that more granular stratification produces more relevant
estimates for each subgroup, but with wider credible intervals due to
diff --git a/articles/AMR_files/figure-html/unnamed-chunk-10-1.png b/articles/AMR_files/figure-html/unnamed-chunk-10-1.png
index 2e3352880..23f21cff2 100644
Binary files a/articles/AMR_files/figure-html/unnamed-chunk-10-1.png and b/articles/AMR_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/AMR_files/figure-html/wisca_plots-1.png b/articles/AMR_files/figure-html/wisca_plots-1.png
index e9a0e3803..28e66e6e9 100644
Binary files a/articles/AMR_files/figure-html/wisca_plots-1.png and b/articles/AMR_files/figure-html/wisca_plots-1.png differ
diff --git a/articles/AMR_files/figure-html/wisca_plots-2.png b/articles/AMR_files/figure-html/wisca_plots-2.png
index e1db7c902..fbfe4c18e 100644
Binary files a/articles/AMR_files/figure-html/wisca_plots-2.png and b/articles/AMR_files/figure-html/wisca_plots-2.png differ
diff --git a/articles/AMR_files/figure-html/wisca_plots-3.png b/articles/AMR_files/figure-html/wisca_plots-3.png
index ed710852e..6f3094130 100644
Binary files a/articles/AMR_files/figure-html/wisca_plots-3.png and b/articles/AMR_files/figure-html/wisca_plots-3.png differ
diff --git a/articles/AMR_for_Python.html b/articles/AMR_for_Python.html
index 59b8b848e..006cb93ee 100644
--- a/articles/AMR_for_Python.html
+++ b/articles/AMR_for_Python.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/articles/AMR_with_tidymodels.html b/articles/AMR_with_tidymodels.html
index 11f94235f..e8117a03d 100644
--- a/articles/AMR_with_tidymodels.html
+++ b/articles/AMR_with_tidymodels.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/articles/EUCAST.html b/articles/EUCAST.html
index ca3dc6330..c0bfc5acf 100644
--- a/articles/EUCAST.html
+++ b/articles/EUCAST.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/articles/PCA.html b/articles/PCA.html
index 4f0bdacc8..65914b547 100644
--- a/articles/PCA.html
+++ b/articles/PCA.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/articles/WHONET.html b/articles/WHONET.html
index 039cc912f..ad575577a 100644
--- a/articles/WHONET.html
+++ b/articles/WHONET.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/articles/WISCA.html b/articles/WISCA.html
index 711df6938..af9904b81 100644
--- a/articles/WISCA.html
+++ b/articles/WISCA.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -553,8 +553,9 @@ distinguished.
conf_interval = 0.95: coverage interval width
-combine_SI = TRUE: count “I” and “SDD” as
-susceptible
+guideline = "EUCAST" (or the AMR_guideline
+option): count “I” and “SDD” as covered; use
+guideline = "CLSI" to count only “SDD” as covered
diff --git a/articles/WISCA.md b/articles/WISCA.md
index 499a5dc9d..7bce7ae5f 100644
--- a/articles/WISCA.md
+++ b/articles/WISCA.md
@@ -367,7 +367,9 @@ wisca_plot(wisca_out, wisca_plot_type = "posterior_coverage")
- `simulations = 1000`: number of Monte Carlo draws
- `conf_interval = 0.95`: coverage interval width
-- `combine_SI = TRUE`: count “I” and “SDD” as susceptible
+- `guideline = "EUCAST"` (or the `AMR_guideline` option): count “I” and
+ “SDD” as covered; use `guideline = "CLSI"` to count only “SDD” as
+ covered
## Practical considerations
diff --git a/articles/datasets.html b/articles/datasets.html
index 18f8e1cae..ecbc859e5 100644
--- a/articles/datasets.html
+++ b/articles/datasets.html
@@ -30,7 +30,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -441,7 +441,7 @@ column names: ab, cid, name, group, a
iv_ddd, iv_units, and loinc.
This data set is in R available as antimicrobials, after
you load the AMR package.
-
It was last updated on 10 October 2026 07:42:25 UTC. Find more info
+
It was last updated on 15 October 2026 08:31:07 UTC. Find more info
about the contents, (scientific) source, and structure of this data set
here.
Direct download links:
diff --git a/articles/datasets.md b/articles/datasets.md
index e35653ecc..578813bc0 100644
--- a/articles/datasets.md
+++ b/articles/datasets.md
@@ -100,7 +100,7 @@ names:
This data set is in R available as `antimicrobials`, after you load the
`AMR` package.
-It was last updated on 10 October 2026 07:42:25 UTC. Find more info
+It was last updated on 15 October 2026 08:31:07 UTC. Find more info
about the contents, (scientific) source, and structure of this [data set
here](https://amr-for-r.org/reference/antimicrobials.html).
diff --git a/articles/index.html b/articles/index.html
index 3dfa8ed5b..bdca00f3f 100644
--- a/articles/index.html
+++ b/articles/index.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/authors.html b/authors.html
index 0236d856f..9f5814400 100644
--- a/authors.html
+++ b/authors.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/favicon-16x16.png b/favicon-16x16.png
deleted file mode 100644
index 0d18bab41..000000000
Binary files a/favicon-16x16.png and /dev/null differ
diff --git a/favicon-32x32.png b/favicon-32x32.png
deleted file mode 100644
index b9479fb4a..000000000
Binary files a/favicon-32x32.png and /dev/null differ
diff --git a/favicon-96x96.png b/favicon-96x96.png
new file mode 100644
index 000000000..055b32127
Binary files /dev/null and b/favicon-96x96.png differ
diff --git a/favicon.ico b/favicon.ico
index acabb5e8a..3405a110a 100644
Binary files a/favicon.ico and b/favicon.ico differ
diff --git a/favicon.svg b/favicon.svg
new file mode 100644
index 000000000..1034c840d
--- /dev/null
+++ b/favicon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/index.html b/index.html
index 8225b6a6a..9f45cbd87 100644
--- a/index.html
+++ b/index.html
@@ -33,7 +33,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -113,7 +113,7 @@
The AMR package is a peer-reviewed, free and open-source R package with zero dependencies to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods.
Our aim has always been to provide a standard for clean and reproducible AMR data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting. We are a team of many different researchers from around the globe to make this a successful and durable project! The AMR package was already cited over 100 times in scientific research.
-
After installing this package, R knows ~103 000 distinct microbial species (updated april 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
+
After installing this package, R knows ~103 000 distinct microbial species (updated April 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
Used in over 175 countries, available in 28 languages
diff --git a/index.md b/index.md
index 0c26a6172..0b645230f 100644
--- a/index.md
+++ b/index.md
@@ -50,7 +50,7 @@ in scientific research.
After installing this package, R knows [**~103 000 distinct microbial
species**](https://amr-for-r.org/reference/microorganisms.md) (updated
-april 2026) and all [**~630 antimicrobial and antiviral
+April 2026) and all [**~630 antimicrobial and antiviral
drugs**](https://amr-for-r.org/reference/antimicrobials.md) by name and
code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED
CT), and knows all about valid SIR and MIC values. The integral clinical
@@ -174,12 +174,11 @@ full explanation.
wisca(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
minimum = 10) # Recommended threshold: >=30
-#> Warning: invalid microorganism code, NA generated
```
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
-| 69.8% (64.5-74.7%) | 93.6% (92.1-95%) | 89.9% (87-92.5%) |
+| 70.2% (65-75.4%) | 93.6% (92-95.1%) | 89.9% (87-92.5%) |
WISCA supports stratification by any clinical variable, so you can
generate syndrome-specific or ward-specific coverage estimates:
@@ -190,14 +189,13 @@ wisca(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward",
minimum = 10) # Recommended threshold: >=30
-#> Warning: invalid microorganism code, NA generated
```
| Syndromic Group | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|
-| Clinical | 74.6% (69.1-80.1%) | 93.7% (92.1-95.1%) | 90.3% (87-93.1%) |
-| ICU | 56.9% (48.3-66%) | 86.7% (83.5-89.8%) | 83% (77.9-87.4%) |
-| Outpatient | 57.7% (46.5-69.3%) | 76.6% (70.5-82.2%) | 67.8% (56.9-77.5%) |
+| Clinical | 74.8% (69-80.3%) | 93.7% (92.1-95.1%) | 90.4% (86.8-93.3%) |
+| ICU | 56.7% (48.2-65.4%) | 86.6% (83.3-89.6%) | 83.1% (78.2-87.5%) |
+| Outpatient | 57.6% (46-69%) | 76.4% (69.8-81.7%) | 68% (57.7-77.5%) |
**For AMR surveillance**, traditional antibiograms remain the right tool
for tracking resistance per species over time:
diff --git a/llms.txt b/llms.txt
index cc1b9ee67..3a9050c52 100644
--- a/llms.txt
+++ b/llms.txt
@@ -50,7 +50,7 @@ in scientific research.
After installing this package, R knows [**~103 000 distinct microbial
species**](https://amr-for-r.org/reference/microorganisms.md) (updated
-april 2026) and all [**~630 antimicrobial and antiviral
+April 2026) and all [**~630 antimicrobial and antiviral
drugs**](https://amr-for-r.org/reference/antimicrobials.md) by name and
code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED
CT), and knows all about valid SIR and MIC values. The integral clinical
@@ -174,12 +174,11 @@ full explanation.
wisca(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
minimum = 10) # Recommended threshold: >=30
-#> Warning: invalid microorganism code, NA generated
```
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
-| 69.8% (64.5-74.7%) | 93.6% (92.1-95%) | 89.9% (87-92.5%) |
+| 70.2% (65-75.4%) | 93.6% (92-95.1%) | 89.9% (87-92.5%) |
WISCA supports stratification by any clinical variable, so you can
generate syndrome-specific or ward-specific coverage estimates:
@@ -190,14 +189,13 @@ wisca(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward",
minimum = 10) # Recommended threshold: >=30
-#> Warning: invalid microorganism code, NA generated
```
| Syndromic Group | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|
-| Clinical | 74.6% (69.1-80.1%) | 93.7% (92.1-95.1%) | 90.3% (87-93.1%) |
-| ICU | 56.9% (48.3-66%) | 86.7% (83.5-89.8%) | 83% (77.9-87.4%) |
-| Outpatient | 57.7% (46.5-69.3%) | 76.6% (70.5-82.2%) | 67.8% (56.9-77.5%) |
+| Clinical | 74.8% (69-80.3%) | 93.7% (92.1-95.1%) | 90.4% (86.8-93.3%) |
+| ICU | 56.7% (48.2-65.4%) | 86.6% (83.3-89.6%) | 83.1% (78.2-87.5%) |
+| Outpatient | 57.6% (46-69%) | 76.4% (69.8-81.7%) | 68% (57.7-77.5%) |
**For AMR surveillance**, traditional antibiograms remain the right tool
for tracking resistance per species over time:
@@ -849,12 +847,13 @@ component analysis).
[`facet_sir()`](https://amr-for-r.org/reference/plot.md)
[`scale_y_percent()`](https://amr-for-r.org/reference/plot.md)
[`scale_sir_colours()`](https://amr-for-r.org/reference/plot.md)
- [`theme_sir()`](https://amr-for-r.org/reference/plot.md)
- [`labels_sir_count()`](https://amr-for-r.org/reference/plot.md) :
- Plotting Helpers for AMR Data Analysis
+ [`theme_sir()`](https://amr-for-r.org/reference/plot.md) : Plotting
+ Helpers for AMR Data Analysis
- [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md)
- [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md) :
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md)
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md)
+ :
AMR Plots with `ggplot2`
diff --git a/logo.svg b/logo.svg
index 964c0ecaa..0e9edfaeb 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1,591 +1,2 @@
-
-
+
+
\ No newline at end of file
diff --git a/news/index.html b/news/index.html
index 39a2c0ab6..d764d5f9c 100644
--- a/news/index.html
+++ b/news/index.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -49,10 +49,10 @@
-
AMR 3.0.1.9137
+
AMR 3.0.1.9138
Planned as v3.1.0, mid October 2026.
-
Breaking
+
Breaking
The former kingdoms Bacteria and Archaea are now each divided into four kingdoms, with new top-level domains Bacteria and Archaea (Göker and Oren, 2024, DOI: 10.1099/ijsem.0.006242). Following this, a new domain column was added to the microorganisms data set, and mo_kingdom() now returns the formal kingdom (e.g., "Pseudomonadati" instead of "Bacteria"). Use mo_domain() for the old behaviour. For non-prokaryotic kingdoms (Fungi, Protozoa, etc.), kingdom and domain are identical.
@@ -105,10 +105,11 @@
Parallel computing in as.sir(), antibiogram(), and wisca() now uses the future and future.apply packages, which is faster. A non-sequential plan (e.g., future::plan(future::multisession)) must be active before using parallel = TRUE (#281).
The options of capped_mic_handling in as.sir() have been redefined as "none", "conservative", "standard" (default), and "lenient". The option "inverse" is no longer available (#243).
as.sir() now returns WT/NWT (Wildtype/Non-wildtype) instead of S/R when using ECOFF-based interpretation with breakpoint_type = "ECOFF". WT/NWT results are fully supported in all resistance and susceptibility functions and in all plots (#254).
-
count_df(), proportion_df(), and sir_df() now follow the AMR_guideline option through their new guideline argument. With CLSI, combine_SI = TRUE merges ‘I’ with R into "IR" and returns "S" vs. "IR", consistent with count_susceptible() and susceptibility(). Previously, these functions always merged ‘I’ with S, as with EUCAST. Use guideline = "EUCAST" for the old behaviour. This also applies to ggplot_sir(), geom_sir(), and labels_sir_count(), which got the same argument.
+
Aggregated analyses now follow the guideline for the ‘I’ category, set with the new guideline argument or the AMR_guideline option: EUCAST considers ‘I’ susceptible and CLSI considers ‘I’ resistant, while SDD and WT are always considered susceptible, and NWT and NS always resistant (see section Interpretation of SIR in ?as.sir). This applies to count_df(), proportion_df(), sir_df(), ggplot_sir(), geom_sir(), and labels_sir_count(), which with CLSI now return "S" vs. "IR" instead of "SI" vs. "R", and to antibiogram(), wisca(), and format() on the output of bug_drug_combinations(). Previously, these functions always considered ‘I’ susceptible, as with EUCAST. Use guideline = "EUCAST" for the old behaviour.
+
The combine_SI argument of these functions is deprecated in favour of guideline. While set, it is followed literally and takes precedence over guideline. Use guideline = NULL instead of combine_SI = FALSE to keep S, I, and R separate.
-
New
+
New
Updated clinical breakpoints
EUCAST 2026 and CLSI 2026 are now supported, by adding over 5,700 new breakpoints to the clinical_breakpoints data set. EUCAST 2026 is now the default guideline for all MIC and disk diffusion interpretations.
New argument enforce_method ("auto", "mic", or "disk") to force the interpretation method when S3 class information is lost, e.g., when called from Python (#291)
When input consists of whole numbers only, disk zones are now assumed rather than MIC values (#291)
@@ -231,9 +232,12 @@
wisca() now follows Bielicki et al. (2016) more strictly by using for intrinsically resistant pairs, forcing near-zero susceptibility regardless of observed data (based on EUCAST Expected Resistant Phenotypes)
Fixed a bug where both functions failed without the antimicrobials argument if tidyselect was not available, e.g., for binary installations without dplyr
+
Isolates of unknown species are now included in grouped antibiograms and in wisca(), as they already were in traditional antibiograms. They were previously excluded silently, with the warning “invalid microorganism code, NA generated”. This can change WISCA coverage estimates.
+
Grouped traditional antibiograms now show the (translated) pathogen names, as ungrouped antibiograms do, instead of microorganism codes
When EUCAST is assumed because neither the guideline argument nor the AMR_guideline option is set, a message explains how to change this, once per session and not in R Markdown or Quarto documents
count_*() and proportion_*() now handle WT, NWT, NS, and NI results correctly (#321)
Logical comparison (==, !=) of the sir class with a factor is now possible on R >= 4.3
New argument guideline in random_mic() and random_disk(), defaulting to the AMR_guideline option (otherwise EUCAST), so that generated values are based on the latest breakpoints of one guideline instead of those of all guidelines and years combined
+
Fixed format() on the output of bug_drug_combinations(), which counted I and SDD as resistant with the default combine_SI = TRUE, contrary to its documentation. It now reads the guideline used in bug_drug_combinations(), which can be overridden with its own guideline argument, and also counts NS as resistant.
Fixed a bug in g.test() that returned the degrees of freedom as argument instead of parameter, so that they were not printed
Fixed a bug where R could crash after unloading the data.table package, and where suggested packages available on the machine that built the package were used even if they were not available to the user
-
Other
+
Other
Improved console messages with clickable links throughout the package, powered by cli if it is installed (#191, #265)
+
The section Interpretation of SIR (in ?as.sir) now explains for all functions with a guideline argument for aggregated analyses how S, SDD, I, R, WT, NWT, NS, and NI are categorised per guideline. The handling of ‘I’ per MDRO guideline in mdro() will be revised in a future version (#323).
The documentation of get_AMR_locale() now describes the actual order in which the language is determined: the AMR_locale option, then the LANG system variable, then LANGUAGE only if LANG is not set, and then the system locale
Revamped console output of interpretive_rules(), with section headers, S/I/R values styled as in the printing of sir columns in tibbles, and the summary of edits sorted by SIR level, using cli if it is installed (#259)
The printing of custom_interpretive_rules() and custom_mdro_guideline() now styles SIR values as in tibbles, i.e., the colour of I depends on the guideline. WT, NWT, and NS were previously shown as SDD, I, and R, and values other than S and R as I.
diff --git a/news/index.md b/news/index.md
index bf67f61e4..4103e7e6c 100644
--- a/news/index.md
+++ b/news/index.md
@@ -1,6 +1,6 @@
# Changelog
-## AMR 3.0.1.9137
+## AMR 3.0.1.9138
Planned as v3.1.0, mid October 2026.
@@ -63,20 +63,31 @@ Planned as v3.1.0, mid October 2026.
fully supported in all resistance and susceptibility functions and in
all plots ([\#254](https://github.com/msberends/AMR/issues/254)).
-- [`count_df()`](https://amr-for-r.org/reference/count.md),
+- Aggregated analyses now follow the guideline for the ‘I’ category, set
+ with the new `guideline` argument or the `AMR_guideline` option:
+ EUCAST considers ‘I’ susceptible and CLSI considers ‘I’ resistant,
+ while SDD and WT are always considered susceptible, and NWT and NS
+ always resistant (see section *Interpretation of SIR* in
+ [`?as.sir`](https://amr-for-r.org/reference/as.sir.md)). This applies
+ to [`count_df()`](https://amr-for-r.org/reference/count.md),
[`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
- and [`sir_df()`](https://amr-for-r.org/reference/proportion.md) now
- follow the `AMR_guideline` option through their new `guideline`
- argument. With CLSI, `combine_SI = TRUE` merges ‘I’ with R into `"IR"`
- and returns `"S"` vs. `"IR"`, consistent with
- [`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
- [`susceptibility()`](https://amr-for-r.org/reference/proportion.md).
- Previously, these functions always merged ‘I’ with S, as with EUCAST.
- Use `guideline = "EUCAST"` for the old behaviour. This also applies to
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
[`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
[`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md), and
- [`labels_sir_count()`](https://amr-for-r.org/reference/plot.md), which
- got the same argument.
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ which with CLSI now return `"S"` vs. `"IR"` instead of `"SI"`
+ vs. `"R"`, and to
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the output of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Previously, these functions always considered ‘I’ susceptible, as with
+ EUCAST. Use `guideline = "EUCAST"` for the old behaviour.
+
+- The `combine_SI` argument of these functions is deprecated in favour
+ of `guideline`. While set, it is followed literally and takes
+ precedence over `guideline`. Use `guideline = NULL` instead of
+ `combine_SI = FALSE` to keep S, I, and R separate.
#### New
@@ -339,17 +350,35 @@ Planned as v3.1.0, mid October 2026.
- Fixed a bug where both functions failed without the `antimicrobials`
argument if `tidyselect` was not available, e.g., for binary
installations without `dplyr`
+ - Isolates of unknown species are now included in grouped antibiograms
+ and in [`wisca()`](https://amr-for-r.org/reference/antibiogram.md),
+ as they already were in traditional antibiograms. They were
+ previously excluded silently, with the warning “invalid
+ microorganism code, NA generated”. This can change WISCA coverage
+ estimates.
+ - Grouped traditional antibiograms now show the (translated) pathogen
+ names, as ungrouped antibiograms do, instead of microorganism codes
- Resistance and susceptibility calculation
- - New argument `guideline` (default: EUCAST) in
+ - New argument `guideline` (default: the `AMR_guideline` option,
+ otherwise EUCAST) in
[`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
[`resistance()`](https://amr-for-r.org/reference/proportion.md),
[`count_df()`](https://amr-for-r.org/reference/count.md),
[`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
[`sir_df()`](https://amr-for-r.org/reference/proportion.md),
[`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
- [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md), and
- [`labels_sir_count()`](https://amr-for-r.org/reference/plot.md) to
- interpret the ‘I’ category correctly per guideline
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md)
+ to interpret the ‘I’ category correctly per guideline. Functions
+ that return results per category also accept `guideline = NULL` to
+ keep S, I, and R separate, while functions that return a single
+ proportion or count give an informative error.
+ - When EUCAST is assumed because neither the `guideline` argument nor
+ the `AMR_guideline` option is set, a message explains how to change
+ this, once per session and not in R Markdown or Quarto documents
- `count_*()` and `proportion_*()` now handle WT, NWT, NS, and NI
results correctly
([\#321](https://github.com/msberends/AMR/issues/321))
@@ -429,6 +458,15 @@ Planned as v3.1.0, mid October 2026.
defaulting to the `AMR_guideline` option (otherwise EUCAST), so that
generated values are based on the latest breakpoints of one guideline
instead of those of all guidelines and years combined
+- Fixed [`format()`](https://rdrr.io/r/base/format.html) on the output
+ of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ which counted I and SDD as resistant with the default
+ `combine_SI = TRUE`, contrary to its documentation. It now reads the
+ guideline used in
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ which can be overridden with its own `guideline` argument, and also
+ counts NS as resistant.
- Fixed a bug in [`g.test()`](https://amr-for-r.org/reference/g.test.md)
that returned the degrees of freedom as `argument` instead of
`parameter`, so that they were not printed
@@ -443,6 +481,17 @@ Planned as v3.1.0, mid October 2026.
powered by `cli` if it is installed
([\#191](https://github.com/msberends/AMR/issues/191),
[\#265](https://github.com/msberends/AMR/issues/265))
+- The section *Interpretation of SIR* (in
+ [`?as.sir`](https://amr-for-r.org/reference/as.sir.md)) now explains
+ for all functions with a `guideline` argument for aggregated analyses
+ how S, SDD, I, R, WT, NWT, NS, and NI are categorised per guideline.
+ The handling of ‘I’ per MDRO guideline in
+ [`mdro()`](https://amr-for-r.org/reference/mdro.md) will be revised in
+ a future version
+ ([\#323](https://github.com/msberends/AMR/issues/323)).
+- [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md)
+ is now documented together with
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md)
- The documentation of
[`get_AMR_locale()`](https://amr-for-r.org/reference/translate.md) now
describes the actual order in which the language is determined: the
diff --git a/pkgdown.yml b/pkgdown.yml
index 2b4acdcce..367f7c86d 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -10,7 +10,7 @@ articles:
PCA: PCA.html
WHONET: WHONET.html
WISCA: WISCA.html
-last_built: 2026-10-15T06:29Z
+last_built: 2026-10-15T09:56Z
urls:
reference: https://amr-for-r.org/reference
article: https://amr-for-r.org/articles
diff --git a/reference/AMR-deprecated.html b/reference/AMR-deprecated.html
index 6320aa256..0dea214e7 100644
--- a/reference/AMR-deprecated.html
+++ b/reference/AMR-deprecated.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/AMR-options.html b/reference/AMR-options.html
index 83be6c412..394d51999 100644
--- a/reference/AMR-options.html
+++ b/reference/AMR-options.html
@@ -9,7 +9,7 @@ options(AMR_guideline = "CLSI")'>AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -68,7 +68,7 @@ options(AMR_guideline = "CLSI")'>add_custom_antimicrobials().
AMR_custom_mo A file location to an RDS file, to use custom microorganisms with this package. This is explained in add_custom_microorganisms().
AMR_eucastrules A character to set the default types of rules for eucast_rules() function, must be one or more of: "breakpoints", "expert", "other", "custom", "all", and defaults to c("breakpoints", "expert").
-
AMR_guideline A character to set the default guideline used throughout the AMR package wherever a guideline argument is available. This option is used as the default in e.g. as.sir(), resistance(), susceptibility(), interpretive_rules() and many plotting functions. While unset, the AMR package uses the latest implemented EUCAST guideline (currently EUCAST 2026).
For as.sir(), this determines which clinical breakpoint guideline is used to interpret MIC values and disk diffusion diameters. It can be either the guideline name (e.g., "CLSI" or "EUCAST") or the name including a year (e.g., "CLSI 2019"). Supported guidelines are EUCAST 2011 to 2026, and CLSI 2011 to 2026.
+
AMR_guideline A character to set the default guideline used throughout the AMR package wherever a guideline argument is available. This option is used as the default in e.g. as.sir(), resistance(), susceptibility(), interpretive_rules() and many plotting functions. While unset, the AMR package uses the latest implemented EUCAST guideline (currently EUCAST 2026). In aggregated analyses, this option determines whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI), see section Interpretation of SIR in as.sir(); setting it also silences the message that EUCAST is assumed.
For as.sir(), this determines which clinical breakpoint guideline is used to interpret MIC values and disk diffusion diameters. It can be either the guideline name (e.g., "CLSI" or "EUCAST") or the name including a year (e.g., "CLSI 2019"). Supported guidelines are EUCAST 2011 to 2026, and CLSI 2011 to 2026.
For resistance() and susceptibility(), this setting determines how the "I" (Intermediate / Increased exposure) category is handled in calculations. Under CLSI, "I" is considered resistant in susceptibility calculations; under EUCAST, "I" is considered susceptible in susceptibility calculations. Explicitly setting this option ensures reproducible AMR proportion estimates.
For interpretive_rules(), this determines which guideline-specific interpretive (expert) rules are applied to antimicrobial test results, either EUCAST or CLSI.
For many plotting functions (e.g., for MIC or disk diffusion values), supplying mo and ab enables automatic SIR-based interpretative colouring. These colours are derived from as.sir() in the background and therefore depend on the active guideline setting, which again uses EUCAST 2026 if not set explicitly.
diff --git a/reference/AMR-options.md b/reference/AMR-options.md
index ecf4494bd..3a073315b 100644
--- a/reference/AMR-options.md
+++ b/reference/AMR-options.md
@@ -63,7 +63,12 @@ the `AMR` package. Set them using the
[`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
[`interpretive_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
and many plotting functions. **While unset**, the AMR package uses the
- latest implemented EUCAST guideline (currently EUCAST 2026).
+ latest implemented EUCAST guideline (currently EUCAST 2026). In
+ aggregated analyses, this option determines whether the 'I' category
+ is considered susceptible (EUCAST) or resistant (CLSI), see section
+ *Interpretation of SIR* in
+ [`as.sir()`](https://amr-for-r.org/reference/as.sir.md); setting it
+ also silences the message that EUCAST is assumed.
- For [`as.sir()`](https://amr-for-r.org/reference/as.sir.md), this
determines which clinical breakpoint guideline is used to interpret
diff --git a/reference/AMR.html b/reference/AMR.html
index 5105aef27..69a6a2002 100644
--- a/reference/AMR.html
+++ b/reference/AMR.html
@@ -5,14 +5,14 @@ This work was published in the Journal of Statistical Software (Volume 104(3); d
) and formed the basis of two PhD theses (doi:10.33612/diss.177417131
and doi:10.33612/diss.192486375
).
-After installing this package, R knows ~103 000 distinct microbial species (updated april 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
+After installing this package, R knows ~103 000 distinct microbial species (updated April 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Hindi, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swahili, Swedish, Turkish, Ukrainian, Urdu, and Vietnamese. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.">
Skip to contents
@@ -21,7 +21,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -70,7 +70,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
) and formed the basis of two PhD theses (doi:10.33612/diss.177417131
and doi:10.33612/diss.192486375
).
-
After installing this package, R knows ~103 000 distinct microbial species (updated april 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
+
After installing this package, R knows ~103 000 distinct microbial species (updated April 2026) and all ~630 antimicrobial and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI 2011-2026 and EUCAST 2011-2026 are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen and the University Medical Center Groningen.
The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Hindi, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swahili, Swedish, Turkish, Ukrainian, Urdu, and Vietnamese. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
diff --git a/reference/AMR.md b/reference/AMR.md
index 2abd4b1c4..900ac3b03 100644
--- a/reference/AMR.md
+++ b/reference/AMR.md
@@ -25,7 +25,7 @@ and
After installing this package, R knows [**~103 000 distinct microbial
species**](https://amr-for-r.org/reference/microorganisms.html) (updated
-april 2026) and all [**~630 antimicrobial and antiviral
+April 2026) and all [**~630 antimicrobial and antiviral
drugs**](https://amr-for-r.org/reference/antimicrobials.html) by name
and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED
CT), and knows all about valid SIR and MIC values. The integral clinical
diff --git a/reference/WHOCC.html b/reference/WHOCC.html
index 20b5634de..11c8f18af 100644
--- a/reference/WHOCC.html
+++ b/reference/WHOCC.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/WHONET.html b/reference/WHONET.html
index 8df3f7000..158953d29 100644
--- a/reference/WHONET.html
+++ b/reference/WHONET.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/ab_from_text.html b/reference/ab_from_text.html
index 67c2bbd6c..53cbe528b 100644
--- a/reference/ab_from_text.html
+++ b/reference/ab_from_text.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/ab_property.html b/reference/ab_property.html
index 3dd9af44f..eb1938e1f 100644
--- a/reference/ab_property.html
+++ b/reference/ab_property.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/add_custom_antimicrobials.html b/reference/add_custom_antimicrobials.html
index a767570bc..c32c9070e 100644
--- a/reference/add_custom_antimicrobials.html
+++ b/reference/add_custom_antimicrobials.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/add_custom_microorganisms.html b/reference/add_custom_microorganisms.html
index 388099452..ed1ee3e1f 100644
--- a/reference/add_custom_microorganisms.html
+++ b/reference/add_custom_microorganisms.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/age.html b/reference/age.html
index f4e305ee3..4c702a61a 100644
--- a/reference/age.html
+++ b/reference/age.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/age_groups.html b/reference/age_groups.html
index 99a77165f..ba0c3ad87 100644
--- a/reference/age_groups.html
+++ b/reference/age_groups.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -155,6 +155,11 @@ The default is to split on young children (0-11), youth (12-24), young adults (2
)}#> Loading required package: ggplot2
+#>ℹ `ggplot_sir()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.# }
diff --git a/reference/age_groups.md b/reference/age_groups.md
index 932ee9b03..71c7d3e85 100644
--- a/reference/age_groups.md
+++ b/reference/age_groups.md
@@ -123,6 +123,11 @@ if (require("dplyr") && require("ggplot2")) {
)
}
#> Loading required package: ggplot2
+#> ℹ `ggplot_sir()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
# }
```
diff --git a/reference/amr-tidymodels.html b/reference/amr-tidymodels.html
index b0a055792..59760d2ca 100644
--- a/reference/amr-tidymodels.html
+++ b/reference/amr-tidymodels.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/amr_course.html b/reference/amr_course.html
index ee84a077c..5e325776d 100644
--- a/reference/amr_course.html
+++ b/reference/amr_course.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/antibiogram-1.png b/reference/antibiogram-1.png
index 6a70f85f7..eeb8f7438 100644
Binary files a/reference/antibiogram-1.png and b/reference/antibiogram-1.png differ
diff --git a/reference/antibiogram-3.png b/reference/antibiogram-3.png
index c645ecf7b..12f1c5d97 100644
Binary files a/reference/antibiogram-3.png and b/reference/antibiogram-3.png differ
diff --git a/reference/antibiogram-5.png b/reference/antibiogram-5.png
index e3bbbc16f..0a8762987 100644
Binary files a/reference/antibiogram-5.png and b/reference/antibiogram-5.png differ
diff --git a/reference/antibiogram-6.png b/reference/antibiogram-6.png
index 1e56c35a4..da52fed14 100644
Binary files a/reference/antibiogram-6.png and b/reference/antibiogram-6.png differ
diff --git a/reference/antibiogram.html b/reference/antibiogram.html
index a3776cfe5..435dc6e68 100644
--- a/reference/antibiogram.html
+++ b/reference/antibiogram.html
@@ -13,7 +13,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -74,7 +74,8 @@ All antibiogram types adhere to previously described approaches (see Source), an
formatting_type =getOption("AMR_antibiogram_formatting_type", 14), col_mo =NULL, language =get_AMR_locale(),
- combine_SI =TRUE,
+combine_SI,
+ guideline =getOption("AMR_guideline", "EUCAST"), sep =" + ", sort_columns =TRUE, simulations =1000,
@@ -98,7 +99,8 @@ All antibiogram types adhere to previously described approaches (see Source), an
col_mo =NULL, language =get_AMR_locale(), minimum =30,
- combine_SI =TRUE,
+combine_SI,
+ guideline =getOption("AMR_guideline", "EUCAST"), sep =" + ", sort_columns =TRUE, wisca =FALSE,
@@ -195,7 +197,11 @@ All antibiogram types adhere to previously described approaches (see Source), an
combine_SI
-
A logical to indicate whether all susceptibility should be determined by results of either S, SDD, or I, instead of only S (default is TRUE).
+
(deprecated in favour of guideline) A logical. If set, it takes precedence over guideline: TRUE considers S, SDD, and I susceptible, and FALSE only S.
+
+
+
guideline
+
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). 'SDD' is always considered susceptible. The default is the package option AMR_guideline, or "EUCAST" if it is not set. See section Interpretation of SIR below.
sep
@@ -350,7 +356,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
Inclusion in Combination Antibiograms
-
For combination antibiograms, the results of the antimicrobials are combined using the same rules as sir_combine(), see the section Combination Therapy below. Whether isolates must be tested for all antimicrobials can be set with the only_all_tested argument (default is FALSE). The 'I' and 'SDD' categories are considered susceptible if combine_SI = TRUE (default), which also determines whether a missing result can be ignored. To use a combination in other analyses as well, create a new variable with sir_combine().
+
For combination antibiograms, the results of the antimicrobials are combined using the same rules as sir_combine(), see the section Combination Therapy below. Whether isolates must be tested for all antimicrobials can be set with the only_all_tested argument (default is FALSE). Whether the 'I' category is considered susceptible follows the guideline argument, which also determines whether a missing result can be ignored. To use a combination in other analyses as well, create a new variable with sir_combine().
@@ -405,7 +411,20 @@ All antibiogram types adhere to previously described approaches (see Source), an
With only_all_tested = TRUE, all these functions count the result of the combination therapy ("most_susceptible") of isolates tested for all antimicrobials, so that:
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' and 'SDD' categories are considered susceptible if combine_SI = TRUE (default), and the result is then reduced to S or R.
+
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' category is considered susceptible or not following the guideline argument ('SDD' is always considered susceptible), and the result is then reduced to S or R.
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
References
@@ -456,14 +475,18 @@ All antibiogram types adhere to previously described approaches (see Source), an
wisca(example_isolates, antimicrobials =c("AMC", "AMC+CIP", "AMC+GEN"))
-#>Warning: invalid microorganism code, NA generated
+#>ℹ `wisca()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible, so S, SDD, and I count as covered. Use `guideline = "CLSI"` to
+#> only count S and SDD as covered. Set the `guideline` argument, or set the
+#> `AMR_guideline` option to change the default (see `?AMR-options`). This
+#> message is shown once per session.#># A tibble: 1 × 3#># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)#># Cred. interval: 95%#># Simulations: 1000 per stratum#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²#><chr><chr><chr>
-#>1 74.2% (72.2-76.1%) 88.8% (87.1-90.3%) 90.8% (89.3-92.2%)
+#>1 74.3% (72.3-76.2%) 88.8% (87.2-90.4%) 90.8% (89.3-92.2%) #># ℹ abbreviated names: ¹`Amoxicillin/clavulanic acid + Ciprofloxacin`,#># ²`Amoxicillin/clavulanic acid + Gentamicin`#># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -475,14 +498,13 @@ All antibiogram types adhere to previously described approaches (see Source), an
antimicrobials =c("AMC", "AMC+CIP", "AMC+GEN"), wisca =TRUE)
-#>Warning: invalid microorganism code, NA generated#># A tibble: 1 × 3#># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)#># Cred. interval: 95%#># Simulations: 1000 per stratum#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²#><chr><chr><chr>
-#>1 74.1% (72.1-75.9%) 88.8% (87.1-90.3%) 90.8% (89.5-92.1%)
+#>1 74.3% (72.4-76.2%) 88.9% (87.3-90.4%) 90.9% (89.4-92.3%) #># ℹ abbreviated names: ¹`Amoxicillin/clavulanic acid + Ciprofloxacin`,#># ²`Amoxicillin/clavulanic acid + Gentamicin`#># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -494,7 +516,6 @@ All antibiogram types adhere to previously described approaches (see Source), an
antimicrobials =c("TZP", "TZP+TOB", "TZP+GEN"), syndromic_group ="ward")
-#>Warning: invalid microorganism code, NA generatedout#># A tibble: 3 × 4#># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -502,9 +523,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
#># Simulations: 1000 per stratum#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹#><chr><chr><chr>
-#>1 Clinical 74.7% (69-80.3%) 93.6% (91.9-95.1%)
-#>2 ICU 57% (48.2-66%) 86.7% (83.5-89.7%)
-#>3 Outpatient 57.5% (46-68.7%) 76.5% (70.6-82.2%)
+#>1 Clinical 74.8% (69-80.1%) 93.7% (92.1-95.2%)
+#>2 ICU 57.2% (49.2-65.4%) 86.6% (83.5-89.7%)
+#>3 Outpatient 57.9% (46.2-69.8%) 76.6% (70.5-82.2%) #># ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`#># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>#># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -535,14 +556,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
#># Simulations: 1000 per stratum#> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹#><chr><chr><chr><chr>
-#>1 0-24 F 57.7% (29.5-82.1%) 70.5% (46.1-89%)
-#>2 0-24 M 59.3% (33.1-84.2%) 76.2% (55.7-90.9%)
-#>3 25-49 F 67.4% (43.3-90.4%) 93.8% (87.8-97.9%)
-#>4 25-49 M 56.9% (27.1-86.5%) 90.9% (82.6-96.8%)
-#>5 50-74 F 68.1% (53.3-82.6%) 96.9% (94.7-98.5%)
-#>6 50-74 M 67.1% (56.3-77.3%) 96.8% (94.3-98.8%)
-#>7 75+ F 73.3% (62.9-83.7%) 97.7% (96.1-98.9%)
-#>8 75+ M 74% (64.1-82.9%) 97.9% (96-99%)
+#>1 0-24 F 57.3% (31.1-82.2%) 70.9% (48.1-88.9%)
+#>2 0-24 M 59.3% (30.7-86.3%) 76.2% (57.5-91.3%)
+#>3 25-49 F 67.2% (43-89.1%) 93.7% (87-97.8%)
+#>4 25-49 M 56.6% (24.9-87.3%) 91.2% (82-97.1%)
+#>5 50-74 F 68.2% (54.1-82.1%) 96.9% (94.4-98.6%)
+#>6 50-74 M 67.2% (56.1-77.4%) 96.8% (94-98.6%)
+#>7 75+ F 73.4% (62.1-84%) 97.7% (95.8-99%)
+#>8 75+ M 73.8% (63.8-82.8%) 97.8% (96.1-99.1%) #># ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`#># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>#># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -558,6 +579,11 @@ All antibiogram types adhere to previously described approaches (see Source), an
#>ℹ For `aminoglycosides()` using columns GEN (gentamicin), TOB (tobramycin), AMK#> (amikacin), and KAN (kanamycin)#>ℹ For `carbapenems()` using columns IPM (imipenem) and MEM (meropenem)
+#>ℹ `antibiogram()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible, so S, SDD, and I count as susceptible. Use `guideline =
+#> "CLSI"` to only count S and SDD as susceptible. Set the `guideline` argument,
+#> or set the `AMR_guideline` option to change the default (see `?AMR-options`).
+#> This message is shown once per session.#># A tibble: 10 × 7#># Type: Traditional Antibiogram#># Conf. interval: 95%
@@ -714,7 +740,6 @@ All antibiogram types adhere to previously described approaches (see Source), an
syndromic_group ="ward")#>ℹ For `ureidopenicillins()` using column TZP (piperacillin/tazobactam)
-#>Warning: invalid microorganism code, NA generated# in an Rmd file, you would just need to return `ureido` in a chunk,# but to be explicit here:
@@ -725,9 +750,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
#>#> |Syndromic Group |Piperacillin/tazobactam |#> |:---------------|:-----------------------|
-#> |Clinical |74.7% (68.7-79.8%) |
-#> |ICU |56.8% (48.9-65.7%) |
-#> |Outpatient |57.4% (45.6-68.4%) |
+#> |Clinical |74.8% (69.2-80.2%) |
+#> |ICU |57% (48.8-65.9%) |
+#> |Outpatient |57.4% (46.7-68.8%) |# Generate plots with ggplot2 or base R --------------------------------
@@ -740,7 +765,6 @@ All antibiogram types adhere to previously described approaches (see Source), an
antimicrobials =c("AMC", "CIP", "TZP", "TZP+TOB"), syndromic_group ="ward")
-#>Warning: invalid microorganism code, NA generatedif(requireNamespace("ggplot2")){ggplot2::autoplot(ab1)
diff --git a/reference/antibiogram.md b/reference/antibiogram.md
index 8e8a190f9..32d1c4b50 100644
--- a/reference/antibiogram.md
+++ b/reference/antibiogram.md
@@ -36,7 +36,8 @@ wisca(
formatting_type = getOption("AMR_antibiogram_formatting_type", 14),
col_mo = NULL,
language = get_AMR_locale(),
- combine_SI = TRUE,
+ combine_SI,
+ guideline = getOption("AMR_guideline", "EUCAST"),
sep = " + ",
sort_columns = TRUE,
simulations = 1000,
@@ -60,7 +61,8 @@ antibiogram(
col_mo = NULL,
language = get_AMR_locale(),
minimum = 30,
- combine_SI = TRUE,
+ combine_SI,
+ guideline = getOption("AMR_guideline", "EUCAST"),
sep = " + ",
sort_columns = TRUE,
wisca = FALSE,
@@ -205,9 +207,20 @@ knit_print(
- combine_SI:
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- all susceptibility should be determined by results of either S, SDD,
- or I, instead of only S (default is `TRUE`).
+ *(deprecated in favour of `guideline`)* A
+ [logical](https://rdrr.io/r/base/logical.html). If set, it takes
+ precedence over `guideline`: `TRUE` considers S, SDD, and I
+ susceptible, and `FALSE` only S.
+
+- guideline:
+
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI). 'SDD' is always considered
+ susceptible. The default is the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. See section *Interpretation of SIR*
+ below.
- sep:
@@ -499,10 +512,10 @@ combined using the same rules as
[`sir_combine()`](https://amr-for-r.org/reference/sir_combine.md), see
the section *Combination Therapy* below. Whether isolates must be tested
for all antimicrobials can be set with the `only_all_tested` argument
-(default is `FALSE`). The 'I' and 'SDD' categories are considered
-susceptible if `combine_SI = TRUE` (default), which also determines
-whether a missing result can be ignored. To use a combination in other
-analyses as well, create a new variable with
+(default is `FALSE`). Whether the 'I' category is considered susceptible
+follows the `guideline` argument, which also determines whether a
+missing result can be ignored. To use a combination in other analyses as
+well, create a new variable with
[`sir_combine()`](https://amr-for-r.org/reference/sir_combine.md).
### Plotting
@@ -631,9 +644,87 @@ all antimicrobials, so that:
proportion_S() + proportion_I() + proportion_R() = 1
In `antibiogram()` and `wisca()`, the result of the combination therapy
-(`"most_susceptible"`) is used, the 'I' and 'SDD' categories are
-considered susceptible if `combine_SI = TRUE` (default), and the result
-is then reduced to S or R.
+(`"most_susceptible"`) is used, the 'I' category is considered
+susceptible or not following the `guideline` argument ('SDD' is always
+considered susceptible), and the result is then reduced to S or R.
+
+## Interpretation of SIR
+
+In 2019, the European Committee on Antimicrobial Susceptibility Testing
+(EUCAST) has decided to change the definitions of susceptibility testing
+categories S, I, and R
+().
+
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ `antibiogram()`, `wisca()`, and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category, `antibiogram()`, and `wisca()` is deprecated in favour of
+`guideline`. If set, it is followed literally and takes precedence over
+`guideline`.
## References
@@ -712,14 +803,18 @@ example_isolates
wisca(example_isolates,
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN")
)
-#> Warning: invalid microorganism code, NA generated
+#> ℹ `wisca()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible, so S, SDD, and I count as covered. Use `guideline = "CLSI"` to
+#> only count S and SDD as covered. Set the `guideline` argument, or set the
+#> `AMR_guideline` option to change the default (see `?AMR-options`). This
+#> message is shown once per session.
#> # A tibble: 1 × 3
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#>
-#> 1 74.2% (72.2-76.1%) 88.8% (87.1-90.3%) 90.8% (89.3-92.2%)
+#> 1 74.3% (72.3-76.2%) 88.8% (87.2-90.4%) 90.8% (89.3-92.2%)
#> # ℹ abbreviated names: ¹`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -731,14 +826,13 @@ antibiogram(example_isolates,
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN"),
wisca = TRUE
)
-#> Warning: invalid microorganism code, NA generated
#> # A tibble: 1 × 3
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#>
-#> 1 74.1% (72.1-75.9%) 88.8% (87.1-90.3%) 90.8% (89.5-92.1%)
+#> 1 74.3% (72.4-76.2%) 88.9% (87.3-90.4%) 90.9% (89.4-92.3%)
#> # ℹ abbreviated names: ¹`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -750,7 +844,6 @@ out <- wisca(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward"
)
-#> Warning: invalid microorganism code, NA generated
out
#> # A tibble: 3 × 4
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -758,9 +851,9 @@ out
#> # Simulations: 1000 per stratum
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#>
-#> 1 Clinical 74.7% (69-80.3%) 93.6% (91.9-95.1%)
-#> 2 ICU 57% (48.2-66%) 86.7% (83.5-89.7%)
-#> 3 Outpatient 57.5% (46-68.7%) 76.5% (70.6-82.2%)
+#> 1 Clinical 74.8% (69-80.1%) 93.7% (92.1-95.2%)
+#> 2 ICU 57.2% (49.2-65.4%) 86.6% (83.5-89.7%)
+#> 3 Outpatient 57.9% (46.2-69.8%) 76.6% (70.5-82.2%)
#> # ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`
#> # ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -791,14 +884,14 @@ if (requireNamespace("dplyr")) {
#> # Simulations: 1000 per stratum
#> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹
#>
-#> 1 0-24 F 57.7% (29.5-82.1%) 70.5% (46.1-89%)
-#> 2 0-24 M 59.3% (33.1-84.2%) 76.2% (55.7-90.9%)
-#> 3 25-49 F 67.4% (43.3-90.4%) 93.8% (87.8-97.9%)
-#> 4 25-49 M 56.9% (27.1-86.5%) 90.9% (82.6-96.8%)
-#> 5 50-74 F 68.1% (53.3-82.6%) 96.9% (94.7-98.5%)
-#> 6 50-74 M 67.1% (56.3-77.3%) 96.8% (94.3-98.8%)
-#> 7 75+ F 73.3% (62.9-83.7%) 97.7% (96.1-98.9%)
-#> 8 75+ M 74% (64.1-82.9%) 97.9% (96-99%)
+#> 1 0-24 F 57.3% (31.1-82.2%) 70.9% (48.1-88.9%)
+#> 2 0-24 M 59.3% (30.7-86.3%) 76.2% (57.5-91.3%)
+#> 3 25-49 F 67.2% (43-89.1%) 93.7% (87-97.8%)
+#> 4 25-49 M 56.6% (24.9-87.3%) 91.2% (82-97.1%)
+#> 5 50-74 F 68.2% (54.1-82.1%) 96.9% (94.4-98.6%)
+#> 6 50-74 M 67.2% (56.1-77.4%) 96.8% (94-98.6%)
+#> 7 75+ F 73.4% (62.1-84%) 97.7% (95.8-99%)
+#> 8 75+ M 73.8% (63.8-82.8%) 97.8% (96.1-99.1%)
#> # ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`
#> # ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -814,6 +907,11 @@ antibiogram(example_isolates,
#> ℹ For `aminoglycosides()` using columns GEN (gentamicin), TOB (tobramycin), AMK
#> (amikacin), and KAN (kanamycin)
#> ℹ For `carbapenems()` using columns IPM (imipenem) and MEM (meropenem)
+#> ℹ `antibiogram()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible, so S, SDD, and I count as susceptible. Use `guideline =
+#> "CLSI"` to only count S and SDD as susceptible. Set the `guideline` argument,
+#> or set the `AMR_guideline` option to change the default (see `?AMR-options`).
+#> This message is shown once per session.
#> # A tibble: 10 × 7
#> # Type: Traditional Antibiogram
#> # Conf. interval: 95%
@@ -970,7 +1068,6 @@ ureido <- wisca(example_isolates,
syndromic_group = "ward"
)
#> ℹ For `ureidopenicillins()` using column TZP (piperacillin/tazobactam)
-#> Warning: invalid microorganism code, NA generated
# in an Rmd file, you would just need to return `ureido` in a chunk,
# but to be explicit here:
@@ -981,9 +1078,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
-#> |Clinical |74.7% (68.7-79.8%) |
-#> |ICU |56.8% (48.9-65.7%) |
-#> |Outpatient |57.4% (45.6-68.4%) |
+#> |Clinical |74.8% (69.2-80.2%) |
+#> |ICU |57% (48.8-65.9%) |
+#> |Outpatient |57.4% (46.7-68.8%) |
# Generate plots with ggplot2 or base R --------------------------------
@@ -996,7 +1093,6 @@ ab2 <- wisca(example_isolates,
antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"),
syndromic_group = "ward"
)
-#> Warning: invalid microorganism code, NA generated
if (requireNamespace("ggplot2")) {
ggplot2::autoplot(ab1)
diff --git a/reference/antimicrobial_selectors.html b/reference/antimicrobial_selectors.html
index 5d3226a7c..7234b8b9b 100644
--- a/reference/antimicrobial_selectors.html
+++ b/reference/antimicrobial_selectors.html
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %>%
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/antimicrobials.html b/reference/antimicrobials.html
index 4b3d9dff9..9fbd108f0 100644
--- a/reference/antimicrobials.html
+++ b/reference/antimicrobials.html
@@ -9,7 +9,7 @@ The antibiotics data set has been renamed to antimicrobials. The old name will b
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.ab.html b/reference/as.ab.html
index bd9467eef..707ddc130 100644
--- a/reference/as.ab.html
+++ b/reference/as.ab.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.av.html b/reference/as.av.html
index d7bc6ec16..117291d4e 100644
--- a/reference/as.av.html
+++ b/reference/as.av.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.disk.html b/reference/as.disk.html
index ed92657ad..935df914e 100644
--- a/reference/as.disk.html
+++ b/reference/as.disk.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.mic.html b/reference/as.mic.html
index 329084658..4c94fb7d8 100644
--- a/reference/as.mic.html
+++ b/reference/as.mic.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.mo.html b/reference/as.mo.html
index 543fc82d1..c26e46375 100644
--- a/reference/as.mo.html
+++ b/reference/as.mo.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/as.sir.html b/reference/as.sir.html
index cb8924595..017533430 100644
--- a/reference/as.sir.html
+++ b/reference/as.sir.html
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -361,7 +361,13 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
Download Our Reference Data
@@ -463,10 +469,10 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
#># A tibble: 4 × 18#> datetime index method ab_given mo_given host_given input_given#><dttm><int><chr><chr><chr><chr><chr>
-#>1 2026-10-15 06:31:46 1 MIC amoxicillin Escherich… human 8
-#>2 2026-10-15 06:31:46 1 MIC cipro Escherich… human 0.256
-#>3 2026-10-15 06:31:46 1 DISK tobra Escherich… human 16
-#>4 2026-10-15 06:31:47 1 DISK genta Escherich… human 18
+#>1 2026-10-15 09:57:56 1 MIC amoxicillin Escherich… human 8
+#>2 2026-10-15 09:57:56 1 MIC cipro Escherich… human 0.256
+#>3 2026-10-15 09:57:56 1 DISK tobra Escherich… human 16
+#>4 2026-10-15 09:57:56 1 DISK genta Escherich… human 18 #># ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,#># outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,#># breakpoint_S_R <chr>, site <chr>
diff --git a/reference/as.sir.md b/reference/as.sir.md
index 66ae3b394..5b2673b4f 100644
--- a/reference/as.sir.md
+++ b/reference/as.sir.md
@@ -581,14 +581,79 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing
categories S, I, and R
().
-This AMR package follows insight; use
-[`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
-(equal to
-[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md)) to
-determine antimicrobial susceptibility and
-[`count_susceptible()`](https://amr-for-r.org/reference/count.md) (equal
-to [`count_SI()`](https://amr-for-r.org/reference/count.md)) to count
-susceptible isolates.
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## Download Our Reference Data
@@ -722,10 +787,10 @@ sir_interpretation_history()
#> # A tibble: 4 × 18
#> datetime index method ab_given mo_given host_given input_given
#>
-#> 1 2026-10-15 06:31:46 1 MIC amoxicillin Escherich… human 8
-#> 2 2026-10-15 06:31:46 1 MIC cipro Escherich… human 0.256
-#> 3 2026-10-15 06:31:46 1 DISK tobra Escherich… human 16
-#> 4 2026-10-15 06:31:47 1 DISK genta Escherich… human 18
+#> 1 2026-10-15 09:57:56 1 MIC amoxicillin Escherich… human 8
+#> 2 2026-10-15 09:57:56 1 MIC cipro Escherich… human 0.256
+#> 3 2026-10-15 09:57:56 1 DISK tobra Escherich… human 16
+#> 4 2026-10-15 09:57:56 1 DISK genta Escherich… human 18
#> # ℹ 11 more variables: ab , mo , host , input ,
#> # outcome , notes , guideline , ref_table , uti ,
#> # breakpoint_S_R , site
diff --git a/reference/atc_online.html b/reference/atc_online.html
index 65845ede2..85f4befed 100644
--- a/reference/atc_online.html
+++ b/reference/atc_online.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/av_from_text.html b/reference/av_from_text.html
index 0858dc2d8..5a845e106 100644
--- a/reference/av_from_text.html
+++ b/reference/av_from_text.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/av_property.html b/reference/av_property.html
index da7e5b380..a25a4ea47 100644
--- a/reference/av_property.html
+++ b/reference/av_property.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/availability.html b/reference/availability.html
index 7311bbd31..144d346e6 100644
--- a/reference/availability.html
+++ b/reference/availability.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -82,6 +82,10 @@
Examples
availability(example_isolates)
+#>ℹ `resistance()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.#> count available visual_availabilty resistant visual_resistance#> date 2000 100.0% |####################| #> patient 2000 100.0% |####################|
diff --git a/reference/availability.md b/reference/availability.md
index 06195c840..17323583f 100644
--- a/reference/availability.md
+++ b/reference/availability.md
@@ -41,6 +41,10 @@ calculated with
``` r
availability(example_isolates)
+#> ℹ `resistance()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.
#> count available visual_availabilty resistant visual_resistance
#> date 2000 100.0% |####################|
#> patient 2000 100.0% |####################|
diff --git a/reference/bug_drug_combinations.html b/reference/bug_drug_combinations.html
index 6c9705a4f..74afc2920 100644
--- a/reference/bug_drug_combinations.html
+++ b/reference/bug_drug_combinations.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -60,6 +60,7 @@
col_mo =NULL, FUN =mo_shortname, include_n_rows =FALSE,
+ guideline =getOption("AMR_guideline", "EUCAST"),...)
@@ -69,7 +70,8 @@
translate_ab ="name (ab, atc)", language =get_AMR_locale(), minimum =30,
- combine_SI =TRUE,
+combine_SI,
+ guideline =attr(x, "guideline"), add_ab_group =TRUE, remove_intrinsic_resistant =FALSE, decimal.mark =getOption("OutDec"),
@@ -98,6 +100,10 @@
A logical to indicate if the total number of rows must be included in the output.
+
guideline
+
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI) when calculating resistance with format(). The default is the package option AMR_guideline, or "EUCAST" if it is not set. In bug_drug_combinations(), this can also be NULL or FALSE, after which format() requires its own guideline to be set. In format(), the default is the guideline used in bug_drug_combinations(), which can be overridden by setting it. See section Interpretation of SIR below.
+
+
...
Arguments passed on to FUN.
@@ -115,7 +121,7 @@
combine_SI
-
A logical to indicate whether values S, SDD, and I should be summed, so resistance will be based on only R - the default is TRUE.
+
(deprecated in favour of guideline) A logical. If set, it takes precedence over guideline: TRUE bases resistance on R only, and FALSE on SDD, I, and R.
add_ab_group
@@ -139,11 +145,24 @@
Value
-
The function bug_drug_combinations() returns a data.frame with columns "mo", "ab", "S", "SDD", "I", "R", "WT, "NWT", and "total".
+
The function bug_drug_combinations() returns a data.frame with columns "mo", "ab", "S", "SDD", "I", "R", "NI", "WT", "NWT", "NS", and "total".
Details
-
The function format() calculates the resistance per bug-drug combination and returns a table ready for reporting/publishing. Use combine_SI = TRUE (default) to test R vs. S+I and combine_SI = FALSE to test R+I vs. S. This table can also directly be used in R Markdown / Quarto without the need for e.g. knitr::kable().
+
The function format() calculates the resistance per bug-drug combination and returns a table ready for reporting/publishing. Following the guideline, resistance is based on R (EUCAST) or on I and R (CLSI), see section Interpretation of SIR below. This table can also directly be used in R Markdown / Quarto without the need for e.g. knitr::kable().
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
@@ -186,19 +205,24 @@
#>6 (unknown species) CAZ 0 0 0 0 0 0 0 0 0#> Use 'format()' on this result to get a publishable/printable format.format(x, translate_ab ="name (atc)")
+#>ℹ `bug_drug_combinations()` assumes the EUCAST guideline and thus considers the
+#> 'I' category susceptible when calculating resistance in `format()` (R vs.
+#> S+SDD+I). Use `guideline = "CLSI"` for I+R vs. S+SDD. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.#># A tibble: 39 × 12#> Group Drug CoNS `E. coli` `E. faecalis` `K. pneumoniae` `P. aeruginosa`#><chr><chr><chr><chr><chr><chr><chr>#> 1"Aminogl… Amik… "100… " 0.0% … "100.0% (39/… """"
-#> 2"" Gent… " 16… " 2.0% … "100.0% (39/… " 10.3% (6/58)"" 10.0% (3/30)"
+#> 2"" Gent… " 13… " 2.0% … "100.0% (39/… " 10.3% (6/58)"" 0.0% (0/30)"#> 3"" Kana… "100… """100.0% (39/… """100.0% (30/30…#> 4"" Tobr… " 78… " 2.6% … "100.0% (39/… " 10.3% (6/58)"" 0.0% (0/30)"#> 5"Aminope… Amox… " 93… " 50.0% … """100.0% (58/58… "100.0% (30/30…
-#> 6"" Amox… " 42… " 28.9% … """ 15.5% (9/58)""100.0% (30/30…
+#> 6"" Amox… " 42… " 13.1% … """ 10.3% (6/58)""100.0% (30/30…#> 7"" Ampi… " 93… " 50.0% … """100.0% (58/58… "100.0% (30/30…#> 8"Carbape… Imip… " 47… " 0.0% … " 0.0% (0/3… " 0.0% (0/51)"""#> 9"" Mero… " 47… " 0.0% … """ 0.0% (0/53)"""
-#>10"Cephalo… Cefa… " 47… " 3.7% … "100.0% (39/… """100.0% (30/30…
+#>10"Cephalo… Cefa… " 47… " 2.4% … "100.0% (39/… """100.0% (30/30…#># ℹ 29 more rows#># ℹ 5 more variables: `P. mirabilis` <chr>, `S. aureus` <chr>,#># `S. epidermidis` <chr>, `S. hominis` <chr>, `S. pneumoniae` <chr>
diff --git a/reference/bug_drug_combinations.md b/reference/bug_drug_combinations.md
index 5c4be5786..de109219e 100644
--- a/reference/bug_drug_combinations.md
+++ b/reference/bug_drug_combinations.md
@@ -13,6 +13,7 @@ bug_drug_combinations(
col_mo = NULL,
FUN = mo_shortname,
include_n_rows = FALSE,
+ guideline = getOption("AMR_guideline", "EUCAST"),
...
)
@@ -22,7 +23,8 @@ format(
translate_ab = "name (ab, atc)",
language = get_AMR_locale(),
minimum = 30,
- combine_SI = TRUE,
+ combine_SI,
+ guideline = attr(x, "guideline"),
add_ab_group = TRUE,
remove_intrinsic_resistant = FALSE,
decimal.mark = getOption("OutDec"),
@@ -57,6 +59,22 @@ format(
A [logical](https://rdrr.io/r/base/logical.html) to indicate if the
total number of rows must be included in the output.
+- guideline:
+
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI) when calculating resistance
+ with [`format()`](https://rdrr.io/r/base/format.html). The default is
+ the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. In `bug_drug_combinations()`, this can
+ also be `NULL` or `FALSE`, after which
+ [`format()`](https://rdrr.io/r/base/format.html) requires its own
+ `guideline` to be set. In
+ [`format()`](https://rdrr.io/r/base/format.html), the default is the
+ guideline used in `bug_drug_combinations()`, which can be overridden
+ by setting it. See section *Interpretation of SIR* below.
+
- ...:
Arguments passed on to `FUN`.
@@ -86,9 +104,10 @@ format(
- combine_SI:
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- values S, SDD, and I should be summed, so resistance will be based on
- only R - the default is `TRUE`.
+ *(deprecated in favour of `guideline`)* A
+ [logical](https://rdrr.io/r/base/logical.html). If set, it takes
+ precedence over `guideline`: `TRUE` bases resistance on R only, and
+ `FALSE` on SDD, I, and R.
- add_ab_group:
@@ -114,17 +133,97 @@ format(
The function `bug_drug_combinations()` returns a
[data.frame](https://rdrr.io/r/base/data.frame.html) with columns "mo",
-"ab", "S", "SDD", "I", "R", "WT, "NWT", and "total".
+"ab", "S", "SDD", "I", "R", "NI", "WT", "NWT", "NS", and "total".
## Details
The function [`format()`](https://rdrr.io/r/base/format.html) calculates
the resistance per bug-drug combination and returns a table ready for
-reporting/publishing. Use `combine_SI = TRUE` (default) to test R vs.
-S+I and `combine_SI = FALSE` to test R+I vs. S. This table can also
-directly be used in R Markdown / Quarto without the need for e.g.
+reporting/publishing. Following the `guideline`, resistance is based on
+R (EUCAST) or on I and R (CLSI), see section *Interpretation of SIR*
+below. This table can also directly be used in R Markdown / Quarto
+without the need for e.g.
[`knitr::kable()`](https://rdrr.io/pkg/knitr/man/kable.html).
+## Interpretation of SIR
+
+In 2019, the European Committee on Antimicrobial Susceptibility Testing
+(EUCAST) has decided to change the definitions of susceptibility testing
+categories S, I, and R
+().
+
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and `bug_drug_combinations()`. Functions that return a single
+ proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ `bug_drug_combinations()`, require 'I' to be considered either
+ susceptible or resistant, and return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
+
## Examples
``` r
@@ -166,19 +265,24 @@ head(x)
#> 6 (unknown species) CAZ 0 0 0 0 0 0 0 0 0
#> Use 'format()' on this result to get a publishable/printable format.
format(x, translate_ab = "name (atc)")
+#> ℹ `bug_drug_combinations()` assumes the EUCAST guideline and thus considers the
+#> 'I' category susceptible when calculating resistance in `format()` (R vs.
+#> S+SDD+I). Use `guideline = "CLSI"` for I+R vs. S+SDD. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
#> # A tibble: 39 × 12
#> Group Drug CoNS `E. coli` `E. faecalis` `K. pneumoniae` `P. aeruginosa`
#>
#> 1 "Aminogl… Amik… "100… " 0.0% … "100.0% (39/… "" ""
-#> 2 "" Gent… " 16… " 2.0% … "100.0% (39/… " 10.3% (6/58)" " 10.0% (3/30)"
+#> 2 "" Gent… " 13… " 2.0% … "100.0% (39/… " 10.3% (6/58)" " 0.0% (0/30)"
#> 3 "" Kana… "100… "" "100.0% (39/… "" "100.0% (30/30…
#> 4 "" Tobr… " 78… " 2.6% … "100.0% (39/… " 10.3% (6/58)" " 0.0% (0/30)"
#> 5 "Aminope… Amox… " 93… " 50.0% … "" "100.0% (58/58… "100.0% (30/30…
-#> 6 "" Amox… " 42… " 28.9% … "" " 15.5% (9/58)" "100.0% (30/30…
+#> 6 "" Amox… " 42… " 13.1% … "" " 10.3% (6/58)" "100.0% (30/30…
#> 7 "" Ampi… " 93… " 50.0% … "" "100.0% (58/58… "100.0% (30/30…
#> 8 "Carbape… Imip… " 47… " 0.0% … " 0.0% (0/3… " 0.0% (0/51)" ""
#> 9 "" Mero… " 47… " 0.0% … "" " 0.0% (0/53)" ""
-#> 10 "Cephalo… Cefa… " 47… " 3.7% … "100.0% (39/… "" "100.0% (30/30…
+#> 10 "Cephalo… Cefa… " 47… " 2.4% … "100.0% (39/… "" "100.0% (30/30…
#> # ℹ 29 more rows
#> # ℹ 5 more variables: `P. mirabilis` , `S. aureus` ,
#> # `S. epidermidis` , `S. hominis` , `S. pneumoniae`
diff --git a/reference/clinical_breakpoints.html b/reference/clinical_breakpoints.html
index eedf6cbe1..a4947da6c 100644
--- a/reference/clinical_breakpoints.html
+++ b/reference/clinical_breakpoints.html
@@ -21,7 +21,7 @@ Use as.sir() to transform MICs or disks measurements to SIR values.">AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -84,11 +84,11 @@ Use as.sir() to transform MICs or disks measurements to SIR values.">
method Testing method, either "DISK" or "MIC"
site Body site for which the breakpoint must be applied, e.g. "Oral" or "Respiratory"
rank_index Taxonomic rank index of mo from 1 (subspecies/infraspecies) to 7 (non-species related breakpoints), used to choose the most specific breakpoint; blocking rows (see Details) have the rank index of their organism + 0.1
+
rank_index Taxonomic rank index of mo, used to choose the most specific breakpoint (the lowest index): 1 for subspecies and infraspecies, 2 for species, 2.5 for species groups (e.g., Streptococcus group A), 3 for genus, 4 for family, 5 for order, 6 for other groups (e.g., Gram-negative or anaerobic bacteria), and 7 for non-species related (PK-PD) breakpoints. Blocking rows (see Details) have the rank index of their organism + 0.1, e.g., 2.6 for a species group, so that a breakpoint for the same organism always takes precedence.
ab Antimicrobial code as used by this package, EARS-Net and WHONET, see as.ab()
ref_tbl Info about where the guideline rule can be found
disk_dose Dose of the used disk diffusion method
-
breakpoint_S Lowest MIC value or highest number of millimetres that leads to "S", is NA for blocking rows (see Details)
+
breakpoint_S Lowest MIC value or highest number of millimetres that leads to "S", is NA for blocking rows (see Details). EUCAST's off-scale MIC breakpoint of 0.001 mg/L, which indicates that there is no S category, is stored as 0.0001 to keep all isolates out of "S".
breakpoint_R Highest MIC value or lowest number of millimetres that leads to "R", can be NA
uti A logical value (TRUE/FALSE) to indicate whether the rule applies to a urinary tract infection (UTI)
is_SDD A logical value (TRUE/FALSE) to indicate whether the intermediate range between "S" and "R" should be interpreted as "SDD", instead of "I". This currently applies to 72 breakpoints.
diff --git a/reference/clinical_breakpoints.md b/reference/clinical_breakpoints.md
index c23e9373c..32222594b 100644
--- a/reference/clinical_breakpoints.md
+++ b/reference/clinical_breakpoints.md
@@ -51,10 +51,14 @@ A [tibble](https://tibble.tidyverse.org/reference/tibble.html) with 60
[`as.mo()`](https://amr-for-r.org/reference/as.mo.md)
- `rank_index`
- Taxonomic rank index of `mo` from 1 (subspecies/infraspecies) to 7
- (non-species related breakpoints), used to choose the most specific
- breakpoint; blocking rows (see *Details*) have the rank index of their
- organism + 0.1
+ Taxonomic rank index of `mo`, used to choose the most specific
+ breakpoint (the lowest index): 1 for subspecies and infraspecies, 2
+ for species, 2.5 for species groups (e.g., *Streptococcus* group A), 3
+ for genus, 4 for family, 5 for order, 6 for other groups (e.g.,
+ Gram-negative or anaerobic bacteria), and 7 for non-species related
+ (PK-PD) breakpoints. Blocking rows (see *Details*) have the rank index
+ of their organism + 0.1, e.g., 2.6 for a species group, so that a
+ breakpoint for the same organism always takes precedence.
- `ab`
Antimicrobial code as used by this package, EARS-Net and WHONET, see
@@ -68,7 +72,9 @@ A [tibble](https://tibble.tidyverse.org/reference/tibble.html) with 60
- `breakpoint_S`
Lowest MIC value or highest number of millimetres that leads to "S",
- is `NA` for blocking rows (see *Details*)
+ is `NA` for blocking rows (see *Details*). EUCAST's off-scale MIC
+ breakpoint of 0.001 mg/L, which indicates that there is no S category,
+ is stored as 0.0001 to keep all isolates out of "S".
- `breakpoint_R`
Highest MIC value or lowest number of millimetres that leads to "R",
diff --git a/reference/count.html b/reference/count.html
index c90978814..797fca4b8 100644
--- a/reference/count.html
+++ b/reference/count.html
@@ -9,7 +9,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -88,7 +88,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
data, translate_ab ="name", language =get_AMR_locale(),
- combine_SI =TRUE,
+combine_SI, guideline =getOption("AMR_guideline", "EUCAST"))
@@ -106,9 +106,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
guideline
-
Either "EUCAST" (default) or "CLSI". With EUCAST, the 'I' category will be considered as susceptible (see EUCAST website), but with with CLSI, it will be considered resistant. Therefore:
You can also use e.g. count_R() or count_S() instead, to be explicit.
+
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). The default is the package option AMR_guideline, or "EUCAST" if it is not set. For functions that return results per category, i.e., count_df(), proportion_df(), sir_df(), ggplot_sir(), geom_sir(), and labels_sir_count(), this can also be NULL or FALSE to keep S, I, and R separate. See section Interpretation of SIR below.
data
@@ -124,7 +122,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
combine_SI
-
A logical to indicate whether the 'I' category must be merged with another category, so the output only consists of susceptible vs. resistant - the default is TRUE. Following the guideline argument, the output then consists of "SI" (S+SDD+I) vs. "R" with EUCAST, and of "S" (S+SDD) vs. "IR" (I+R) with CLSI.
+
(deprecated in favour of guideline) A logical. If set, it takes precedence over guideline: TRUE merges S, SDD, and I into "SI" vs. "R", and FALSE keeps S, I, and R separate.
@@ -142,7 +140,13 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
This AMR package follows insight; use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.
+
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
Combination Therapy
@@ -175,7 +179,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
With only_all_tested = TRUE, all these functions count the result of the combination therapy ("most_susceptible") of isolates tested for all antimicrobials, so that:
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' and 'SDD' categories are considered susceptible if combine_SI = TRUE (default), and the result is then reduced to S or R.
+
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' category is considered susceptible or not following the guideline argument ('SDD' is always considered susceptible), and the result is then reduced to S or R.
See also
@@ -189,8 +193,16 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
# base R ------------------------------------------------------------count_resistant(example_isolates$AMX)# counts "R"
+#>ℹ `count_resistant()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.#> [1] 804count_susceptible(example_isolates$AMX)# counts "S" and "I"
+#>ℹ `count_susceptible()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.#> [1] 546count_all(example_isolates$AMX)# counts "S", "I" and "R"#> [1] 1350
@@ -220,6 +232,10 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
count_susceptible(example_isolates$AMX)#> [1] 546susceptibility(example_isolates$AMX)*n_sir(example_isolates$AMX)
+#>ℹ `susceptibility()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.#> [1] 546# dplyr -------------------------------------------------------------
@@ -267,6 +283,11 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
}#>ℹ For `aminoglycosides()` using columns GEN (gentamicin), TOB (tobramycin), AMK#> (amikacin), and KAN (kanamycin)
+#>ℹ `count_df()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.#># A tibble: 12 × 4#> ward antibiotic interpretation value#><chr><chr><ord><int>
diff --git a/reference/count.md b/reference/count.md
index 726915282..5422b6101 100644
--- a/reference/count.md
+++ b/reference/count.md
@@ -42,7 +42,7 @@ count_df(
data,
translate_ab = "name",
language = get_AMR_locale(),
- combine_SI = TRUE,
+ combine_SI,
guideline = getOption("AMR_guideline", "EUCAST")
)
```
@@ -66,19 +66,20 @@ count_df(
- guideline:
- Either `"EUCAST"` (default) or `"CLSI"`. With EUCAST, the 'I' category
- will be considered as susceptible (see [EUCAST
- website](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/)),
- but with with CLSI, it will be considered resistant. Therefore:
-
- - EUCAST: `count_susceptible()` \\= N\_{S} + N\_{I}\\,
- `count_resistant()` \\= N\_{R}\\
-
- - CLSI: `count_susceptible()` \\= N\_{S} + N\_{SDD}\\,
- `count_resistant()` \\= N\_{I} + N\_{R}\\
-
- You can also use e.g. `count_R()` or `count_S()` instead, to be
- explicit.
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI). The default is the package
+ option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. For functions that return results per
+ category, i.e., `count_df()`,
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md), and
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ this can also be `NULL` or `FALSE` to keep S, I, and R separate. See
+ section *Interpretation of SIR* below.
- data:
@@ -104,12 +105,10 @@ count_df(
- combine_SI:
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- the 'I' category must be merged with another category, so the output
- only consists of susceptible vs. resistant - the default is `TRUE`.
- Following the `guideline` argument, the output then consists of `"SI"`
- (S+SDD+I) vs. `"R"` with EUCAST, and of `"S"` (S+SDD) vs. `"IR"` (I+R)
- with CLSI.
+ *(deprecated in favour of `guideline`)* A
+ [logical](https://rdrr.io/r/base/logical.html). If set, it takes
+ precedence over `guideline`: `TRUE` merges S, SDD, and I into `"SI"`
+ vs. `"R"`, and `FALSE` keeps S, I, and R separate.
## Value
@@ -145,12 +144,77 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing
categories S, I, and R
().
-This AMR package follows insight; use
-[`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
-(equal to
-[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md)) to
-determine antimicrobial susceptibility and `count_susceptible()` (equal
-to `count_SI()`) to count susceptible isolates.
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category: `count_df()`,
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ `count_resistant()`,
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+`count_susceptible()` and `count_resistant()`) to follow the guideline,
+or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## Combination Therapy
@@ -220,9 +284,10 @@ all antimicrobials, so that:
In [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md) and
[`wisca()`](https://amr-for-r.org/reference/antibiogram.md), the result
-of the combination therapy (`"most_susceptible"`) is used, the 'I' and
-'SDD' categories are considered susceptible if `combine_SI = TRUE`
-(default), and the result is then reduced to S or R.
+of the combination therapy (`"most_susceptible"`) is used, the 'I'
+category is considered susceptible or not following the `guideline`
+argument ('SDD' is always considered susceptible), and the result is
+then reduced to S or R.
## See also
@@ -237,8 +302,16 @@ calculate microbial resistance and susceptibility.
# base R ------------------------------------------------------------
count_resistant(example_isolates$AMX) # counts "R"
+#> ℹ `count_resistant()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.
#> [1] 804
count_susceptible(example_isolates$AMX) # counts "S" and "I"
+#> ℹ `count_susceptible()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.
#> [1] 546
count_all(example_isolates$AMX) # counts "S", "I" and "R"
#> [1] 1350
@@ -268,6 +341,10 @@ n_sir(example_isolates$AMX)
count_susceptible(example_isolates$AMX)
#> [1] 546
susceptibility(example_isolates$AMX) * n_sir(example_isolates$AMX)
+#> ℹ `susceptibility()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible. Use `guideline = "CLSI"` to consider it resistant. Set
+#> the `guideline` argument, or set the `AMR_guideline` option to change the
+#> default (see `?AMR-options`). This message is shown once per session.
#> [1] 546
# dplyr -------------------------------------------------------------
@@ -315,6 +392,11 @@ if (require("dplyr")) {
}
#> ℹ For `aminoglycosides()` using columns GEN (gentamicin), TOB (tobramycin), AMK
#> (amikacin), and KAN (kanamycin)
+#> ℹ `count_df()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
#> # A tibble: 12 × 4
#> ward antibiotic interpretation value
#>
diff --git a/reference/custom_interpretive_rules.html b/reference/custom_interpretive_rules.html
index 20e402fe4..0820e741e 100644
--- a/reference/custom_interpretive_rules.html
+++ b/reference/custom_interpretive_rules.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/custom_mdro_guideline.html b/reference/custom_mdro_guideline.html
index 1097bd1b8..f72b26f1c 100644
--- a/reference/custom_mdro_guideline.html
+++ b/reference/custom_mdro_guideline.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/dosage.html b/reference/dosage.html
index bec6b35e9..48d5d5189 100644
--- a/reference/dosage.html
+++ b/reference/dosage.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/esbl_isolates.html b/reference/esbl_isolates.html
index 542e66a7e..fa964fd75 100644
--- a/reference/esbl_isolates.html
+++ b/reference/esbl_isolates.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/example_isolates.html b/reference/example_isolates.html
index f077c093e..7a16145e1 100644
--- a/reference/example_isolates.html
+++ b/reference/example_isolates.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/example_isolates_unclean.html b/reference/example_isolates_unclean.html
index 51baa3c18..7180431ea 100644
--- a/reference/example_isolates_unclean.html
+++ b/reference/example_isolates_unclean.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/export_ncbi_biosample.html b/reference/export_ncbi_biosample.html
index 786f3f310..3e7e6ab93 100644
--- a/reference/export_ncbi_biosample.html
+++ b/reference/export_ncbi_biosample.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/first_isolate.html b/reference/first_isolate.html
index c89b5d90f..fabee01e6 100644
--- a/reference/first_isolate.html
+++ b/reference/first_isolate.html
@@ -9,7 +9,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/g.test.html b/reference/g.test.html
index 70e324cc3..efc194ff3 100644
--- a/reference/g.test.html
+++ b/reference/g.test.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/get_episode.html b/reference/get_episode.html
index 38322ae1b..7b9a78dbd 100644
--- a/reference/get_episode.html
+++ b/reference/get_episode.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -154,27 +154,27 @@
df<-example_isolates[sample(seq_len(2000), size =100), ]get_episode(df$date, episode_days =60)# indices
-#> [1] 28 47 7 7 6 17 9 4 37 11 43 43 14 38 26 38 12 39 49 18 15 27 5 22 25
-#> [26] 36 11 18 22 41 42 38 33 35 18 45 11 30 40 31 46 19 24 18 17 16 43 46 1 23
-#> [51] 2 18 34 45 21 3 45 12 48 30 10 13 29 40 48 30 2 20 9 19 14 36 19 32 36
-#> [76] 10 44 20 4 4 36 8 48 43 46 9 32 6 8 29 13 6 45 9 12 38 45 44 35 5
+#> [1] 45 9 43 16 28 25 38 32 45 34 2 46 28 49 32 19 33 13 10 6 30 8 30 23 12
+#> [26] 15 15 11 13 1 18 2 19 2 24 4 9 50 19 20 42 31 39 30 32 30 18 20 18 10
+#> [51] 7 27 9 15 48 23 44 21 29 38 23 15 25 20 5 41 46 14 41 34 22 34 40 27 18
+#> [76] 37 4 28 28 37 43 11 47 29 49 29 49 17 19 52 36 3 18 17 7 51 30 35 6 26is_new_episode(df$date, episode_days =60)# TRUE/FALSE
-#> [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE
-#> [13] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
-#> [25] TRUE TRUE FALSE FALSE FALSE TRUE TRUE FALSE TRUE TRUE FALSE TRUE
-#> [37] FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE FALSE
-#> [49] TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE FALSE
-#> [61] TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
-#> [73] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
-#> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
-#> [97] FALSE FALSE FALSE FALSE
+#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
+#> [13] FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE
+#> [25] TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE TRUE
+#> [37] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE
+#> [49] FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE
+#> [61] FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE
+#> [73] TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
+#> [85] FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE
+#> [97] FALSE TRUE FALSE TRUE# filter on results from the third 60-day episode only, using base Rdf[which(get_episode(df$date, 60)==3), ]#># A tibble: 1 × 46
-#> date patient age gender ward mo PEN OXA FLC AMX
-#><date><chr><dbl><chr><chr><mo><sir><sir><sir><sir>
-#>1 2002-06-07 710157 76 M Outpatie… B_STPHY_CONS S NA S NA
+#> date patient age gender ward mo PEN OXA FLC AMX
+#><date><chr><dbl><chr><chr><mo><sir><sir><sir><sir>
+#>1 2002-07-24 F35553 51 M ICU B_STPHY_AURS R NA S R #># ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,#># CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,#># TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
@@ -208,19 +208,19 @@
arrange(patient, condition, date)}#># A tibble: 100 × 4
-#># Groups: patient, condition [95]
+#># Groups: patient, condition [100]#> patient date condition new_episode#><chr><date><chr><lgl>
-#> 1 005088 2017-09-28 B TRUE
-#> 2 010257 2004-04-03 C TRUE
-#> 3 080086 2007-10-26 A TRUE
-#> 4 083080 2012-04-16 B TRUE
-#> 5 0E2483 2008-07-22 B TRUE
-#> 6 141061 2014-10-22 B TRUE
-#> 7 16DC39 2015-11-19 A TRUE
-#> 8 204562 2010-07-03 B TRUE
-#> 9 22B987 2009-10-19 C TRUE
-#>10 257844 2011-05-22 C TRUE
+#> 1 000090 2003-10-08 B TRUE
+#> 2 023456 2009-11-02 C TRUE
+#> 3 0C0688 2014-09-05 C TRUE
+#> 4 0E2483 2007-08-10 C TRUE
+#> 5 105248 2005-06-16 B TRUE
+#> 6 124128 2006-10-02 A TRUE
+#> 7 146F70 2009-08-14 C TRUE
+#> 8 15D386 2004-09-06 B TRUE
+#> 9 174209 2011-10-03 B TRUE
+#>10 174209 2011-10-03 C TRUE #># ℹ 90 more rowsif(require("dplyr")){
@@ -234,19 +234,19 @@
arrange(patient, ward, date)}#># A tibble: 100 × 5
-#># Groups: ward, patient [91]
+#># Groups: ward, patient [94]#> ward date patient new_index new_logical#><chr><date><chr><int><lgl>
-#> 1 Clinical 2017-09-28 005088 1 TRUE
-#> 2 Clinical 2004-04-03 010257 1 TRUE
-#> 3 Clinical 2007-10-26 080086 1 TRUE
-#> 4 Clinical 2012-04-16 083080 1 TRUE
-#> 5 Clinical 2008-07-22 0E2483 1 TRUE
-#> 6 Clinical 2014-10-22 141061 1 TRUE
-#> 7 ICU 2015-11-19 16DC39 1 TRUE
-#> 8 Outpatient 2010-07-03 204562 1 TRUE
-#> 9 Clinical 2009-10-19 22B987 1 TRUE
-#>10 Clinical 2011-05-22 257844 1 TRUE
+#> 1 ICU 2003-10-08 000090 1 TRUE
+#> 2 Clinical 2009-11-02 023456 1 TRUE
+#> 3 Clinical 2014-09-05 0C0688 1 TRUE
+#> 4 ICU 2007-08-10 0E2483 1 TRUE
+#> 5 Clinical 2005-06-16 105248 1 TRUE
+#> 6 Clinical 2006-10-02 124128 1 TRUE
+#> 7 Clinical 2009-08-14 146F70 1 TRUE
+#> 8 ICU 2004-09-06 15D386 1 TRUE
+#> 9 Outpatient 2011-10-03 174209 1 TRUE
+#>10 Outpatient 2011-10-03 174209 1 FALSE #># ℹ 90 more rowsif(require("dplyr")){
@@ -262,9 +262,9 @@
#># A tibble: 3 × 5#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30#><chr><int><int><int><int>
-#>1 Clinical 60 13 39 49
-#>2 ICU 26 11 23 24
-#>3 Outpatient 5 5 5 5
+#>1 Clinical 53 12 30 37
+#>2 ICU 32 10 28 29
+#>3 Outpatient 9 5 9 9# grouping on patients and microorganisms leads to the same# results as first_isolate() when using 'episode-based':
@@ -293,19 +293,19 @@
select(group_vars(.), flag_episode)}#># A tibble: 100 × 4
-#># Groups: patient, mo, ward [94]
-#> patient mo ward flag_episode
-#><chr><mo><chr><lgl>
-#> 1 D91230 B_STPHY_EPDR Clinical TRUE
-#> 2 F5F794 B_STPHY_AURS ICU TRUE
-#> 3 419655 B_STPHY_EPDR Clinical TRUE
-#> 4 010257 B_ESCHR_COLI Clinical TRUE
-#> 5 E60130 B_KLBSL_OXYT Clinical TRUE
-#> 6 693505 B_STPHY_AURS ICU TRUE
-#> 7 E1C9D4 B_STPHY_CONS Clinical TRUE
-#> 8 762305 B_PROTS_MRBL Clinical TRUE
-#> 9 545388 B_STPHY_HMNS Clinical TRUE
-#>10 E02001 B_ESCHR_COLI Clinical TRUE
+#># Groups: patient, mo, ward [97]
+#> patient mo ward flag_episode
+#><chr><mo><chr><lgl>
+#> 1 5FB247 B_PROTS_MRBL Clinical TRUE
+#> 2 B95551 B_STPHY_CONS Outpatient TRUE
+#> 3 335263 B_ENTRBC_CLOC Clinical TRUE
+#> 4 A66134 B_STPHY_AURS Outpatient TRUE
+#> 5 659086 B_HMPHL_INFL Clinical TRUE
+#> 6 971739 B_STPHY_CONS Clinical TRUE
+#> 7 F76D09 B_STRPT_GRPB Clinical TRUE
+#> 8 686445 B_PROTS_MRBL Clinical TRUE
+#> 9 D81C77 B_ESCHR_COLI Clinical TRUE
+#>10 C25552 B_STPHY_CONS Outpatient TRUE #># ℹ 90 more rows# }
A logical to indicate whether the 'I' category must be merged with another category, so the output only consists of susceptible vs. resistant - the default is TRUE. Following the guideline argument, the output then consists of "SI" (S+SDD+I) vs. "R" with EUCAST, and of "S" (S+SDD) vs. "IR" (I+R) with CLSI.
+
(deprecated in favour of guideline) A logical. If set, it takes precedence over guideline: TRUE merges S, SDD, and I into "SI" vs. "R", and FALSE keeps S, I, and R separate.
minimum
@@ -144,9 +156,7 @@
guideline
-
Either "EUCAST" (default) or "CLSI". With EUCAST, the 'I' category will be considered as susceptible (see EUCAST website), but with with CLSI, it will be considered resistant. Therefore:
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). The default is the package option AMR_guideline, or "EUCAST" if it is not set. For functions that return results per category, i.e., count_df(), proportion_df(), sir_df(), ggplot_sir(), geom_sir(), and labels_sir_count(), this can also be NULL or FALSE to keep S, I, and R separate. See section Interpretation of SIR below.
scale_sir_colours() sets colours to the bars (green for S, yellow for I, and red for R). with multilingual support. The default colours are colour-blind friendly, while maintaining the convention that e.g. 'susceptible' should be green and 'resistant' should be red.
labels_sir_count() print datalabels on the bars with percentage and amount of isolates using ggplot2::geom_text().
ggplot_sir() is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (%>%). See Examples.
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
+
Examples
@@ -213,6 +236,11 @@
ggplot(example_isolates%>%select(AMX, NIT, FOS, TMP, CIP))+geom_sir()}
+#>ℹ `geom_sir()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.if(require("ggplot2")&&require("dplyr")){# prettify the plot using some additional functions:
@@ -221,9 +249,14 @@
geom_sir()+scale_y_percent()+scale_sir_colours(aesthetics ="fill")+
-labels_sir_count()+
+labels_sir_count()+theme_sir()}
+#>ℹ `labels_sir_count()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.if(require("ggplot2")&&require("dplyr")){# or better yet, simplify this using the wrapper function - a single command:
diff --git a/reference/ggplot_sir.md b/reference/ggplot_sir.md
index a236a6e08..f8d156eda 100644
--- a/reference/ggplot_sir.md
+++ b/reference/ggplot_sir.md
@@ -17,7 +17,7 @@ ggplot_sir(
breaks = seq(0, 1, 0.1),
limits = NULL,
translate_ab = "name",
- combine_SI = TRUE,
+ combine_SI,
minimum = 30,
language = get_AMR_locale(),
guideline = getOption("AMR_guideline", "EUCAST"),
@@ -42,10 +42,22 @@ geom_sir(
translate_ab = "name",
minimum = 30,
language = get_AMR_locale(),
- combine_SI = TRUE,
+ combine_SI,
guideline = getOption("AMR_guideline", "EUCAST"),
...
)
+
+labels_sir_count(
+ position = NULL,
+ x = "antibiotic",
+ translate_ab = "name",
+ minimum = 30,
+ language = get_AMR_locale(),
+ combine_SI,
+ guideline = getOption("AMR_guideline", "EUCAST"),
+ datalabels.size = 3,
+ datalabels.colour = "grey15"
+)
```
## Arguments
@@ -94,12 +106,10 @@ geom_sir(
- combine_SI:
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- the 'I' category must be merged with another category, so the output
- only consists of susceptible vs. resistant - the default is `TRUE`.
- Following the `guideline` argument, the output then consists of `"SI"`
- (S+SDD+I) vs. `"R"` with EUCAST, and of `"S"` (S+SDD) vs. `"IR"` (I+R)
- with CLSI.
+ *(deprecated in favour of `guideline`)* A
+ [logical](https://rdrr.io/r/base/logical.html). If set, it takes
+ precedence over `guideline`: `TRUE` merges S, SDD, and I into `"SI"`
+ vs. `"R"`, and `FALSE` keeps S, I, and R separate.
- minimum:
@@ -119,31 +129,19 @@ geom_sir(
- guideline:
- Either `"EUCAST"` (default) or `"CLSI"`. With EUCAST, the 'I' category
- will be considered as susceptible (see [EUCAST
- website](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/)),
- but with with CLSI, it will be considered resistant. Therefore:
-
- - EUCAST:
- [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
- \\= \\S + \\I\\,
- [`resistance()`](https://amr-for-r.org/reference/proportion.md) \\=
- \\R\\
-
- - CLSI:
- [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
- \\= \\S + \\SDD\\,
- [`resistance()`](https://amr-for-r.org/reference/proportion.md) \\=
- \\I + \\R\\
-
- You can also use e.g.
- [`proportion_R()`](https://amr-for-r.org/reference/proportion.md) or
- [`proportion_S()`](https://amr-for-r.org/reference/proportion.md)
- instead, to be explicit. For
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI). The default is the package
+ option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. For functions that return results per
+ category, i.e.,
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
[`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
- [`count_df()`](https://amr-for-r.org/reference/count.md), and
- [`sir_df()`](https://amr-for-r.org/reference/proportion.md), the
- guideline determines how 'I' is merged when `combine_SI = TRUE`.
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ `ggplot_sir()`, `geom_sir()`, and `labels_sir_count()`, this can also
+ be `NULL` or `FALSE` to keep S, I, and R separate. See section
+ *Interpretation of SIR* below.
- nrow:
@@ -156,8 +154,7 @@ geom_sir(
- datalabels:
- Show datalabels using
- [`labels_sir_count()`](https://amr-for-r.org/reference/plot.md).
+ Show datalabels using `labels_sir_count()`.
- datalabels.size:
@@ -230,14 +227,92 @@ Additional functions include:
theme](https://ggplot2.tidyverse.org/reference/theme.html) with
minimal distraction.
-- [`labels_sir_count()`](https://amr-for-r.org/reference/plot.md) print
- datalabels on the bars with percentage and amount of isolates using
+- `labels_sir_count()` print datalabels on the bars with percentage and
+ amount of isolates using
[`ggplot2::geom_text()`](https://ggplot2.tidyverse.org/reference/geom_text.html).
`ggplot_sir()` is a wrapper around all above functions that uses data as
first input. This makes it possible to use this function after a pipe
(`%>%`). See *Examples*.
+## Interpretation of SIR
+
+In 2019, the European Committee on Antimicrobial Susceptibility Testing
+(EUCAST) has decided to change the definitions of susceptibility testing
+categories S, I, and R
+().
+
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ `ggplot_sir()`, `geom_sir()`, `labels_sir_count()`, and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
+
## Examples
``` r
@@ -247,6 +322,11 @@ if (require("ggplot2") && require("dplyr")) {
ggplot(example_isolates %>% select(AMX, NIT, FOS, TMP, CIP)) +
geom_sir()
}
+#> ℹ `geom_sir()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
if (require("ggplot2") && require("dplyr")) {
# prettify the plot using some additional functions:
@@ -258,6 +338,11 @@ if (require("ggplot2") && require("dplyr")) {
labels_sir_count() +
theme_sir()
}
+#> ℹ `labels_sir_count()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
if (require("ggplot2") && require("dplyr")) {
# or better yet, simplify this using the wrapper function - a single command:
diff --git a/reference/guess_ab_col.html b/reference/guess_ab_col.html
index 13fe0e840..33b61dc19 100644
--- a/reference/guess_ab_col.html
+++ b/reference/guess_ab_col.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/index.html b/reference/index.html
index eb66a8ad5..2d60466b1 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -314,14 +314,14 @@
diff --git a/reference/mdro.md b/reference/mdro.md
index 2acb74c12..ba230850b 100644
--- a/reference/mdro.md
+++ b/reference/mdro.md
@@ -124,8 +124,10 @@ eucast_exceptional_phenotypes(
behaviour of the `mdro()` function, it follows the redefinition by
EUCAST about the interpretation of I (increased exposure) in 2019, see
section 'Interpretation of S, I and R' below. When using
- `combine_SI = FALSE`, resistance is considered when isolates are R or
- I.
+ `combine_SI = FALSE`, resistance is considered when isolates are R
+ or I. In a future version, the handling of 'I' will follow the
+ selected MDRO guideline
+ ([\#323](https://github.com/msberends/AMR/issues/323)).
- verbose:
@@ -297,14 +299,79 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing
categories S, I, and R
().
-This AMR package follows insight; use
-[`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
-(equal to
-[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md)) to
-determine antimicrobial susceptibility and
-[`count_susceptible()`](https://amr-for-r.org/reference/count.md) (equal
-to [`count_SI()`](https://amr-for-r.org/reference/count.md)) to count
-susceptible isolates.
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## See also
diff --git a/reference/mean_amr_distance.html b/reference/mean_amr_distance.html
index de54d83f8..e61e7db39 100644
--- a/reference/mean_amr_distance.html
+++ b/reference/mean_amr_distance.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -110,31 +110,30 @@
sir<-random_sir(10)sir#> Class <sir>
-#> [1] S R I R R R R I I I
+#> [1] S I I I I I R R I Rmean_amr_distance(sir)
-#> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 0.9486833 0.9486833
-#> [7] 0.9486833 -0.9486833 -0.9486833 -0.9486833
+#> [1] -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 1.449138
+#> [8] 1.449138 -0.621059 1.449138mic<-random_mic(10)mic#> Class <mic>
-#> [1] 0.032 0.032 0.125 0.25 0.016 0.004 <=0.0005 0.016
-#> [9] 0.25 0.5
+#> [1] 0.5 0.008 0.001 0.0001 0.064 0.0002 0.064 0.0001 0.032 1 mean_amr_distance(mic)
-#> [1] -0.02823448 -0.02823448 0.61480238 0.94191703 -0.35534914 -1.00957846
-#> [7] -1.99092244 -0.35534914 0.94191703 1.26903169
+#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
+#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440# equal to the Z-score of their log2:(log2(mic)-mean(log2(mic)))/sd(log2(mic))
-#> [1] -0.02823448 -0.02823448 0.61480238 0.94191703 -0.35534914 -1.00957846
-#> [7] -1.99092244 -0.35534914 0.94191703 1.26903169
+#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
+#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440disk<-random_disk(10)disk#> Class <disk>
-#> [1] 48 45 48 40 44 9 39 49 39 29
+#> [1] 38 37 42 30 40 24 45 36 49 44mean_amr_distance(disk)
-#> [1] 0.74202711 0.49468474 0.74202711 0.08244746 0.41223728 -2.47342369
-#> [7] 0.00000000 0.82447456 0.00000000 -0.82447456
+#> [1] -0.06786705 -0.20360115 0.47506935 -1.15373986 0.20360115 -1.96814446
+#> [7] 0.88227166 -0.33933525 1.42520806 0.74653756y<-data.frame( id =LETTERS[1:10],
@@ -145,35 +144,35 @@
)y#> id amox cipr gent tobr
-#> 1 A R 26 <=2 >=2
-#> 2 B R 28 <=2 1
-#> 3 C R 30 <=2 1
-#> 4 D R 30 <=2 1
-#> 5 E I 31 4 1
-#> 6 F S 28 4 1
-#> 7 G S 32 <=2 >=2
-#> 8 H I 25 <=2 1
-#> 9 I S 21 <=2 1
-#> 10 J R 20 4 1
+#> 1 A I 30 16 >=8
+#> 2 B R 30 <=8 4
+#> 3 C I 28 <=8 4
+#> 4 D I 24 <=8 >=8
+#> 5 E I 28 <=8 4
+#> 6 F S 30 <=8 4
+#> 7 G I 28 <=8 4
+#> 8 H S 31 <=8 >=8
+#> 9 I R 26 <=8 4
+#> 10 J I 28 <=8 >=8mean_amr_distance(y)#>ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and#>"tobr"
-#> [1] 0.48908793 0.01826958 0.14037829 0.14037829 0.24464016 0.06147710
-#> [7] 0.38107241 -0.63923513 -0.88345255 0.04738391
+#> [1] 1.08474449 0.40297922 -0.42682276 -0.41644967 -0.42682276 -0.18994784
+#> [7] -0.42682276 0.41261253 -0.07077061 0.05730016y$amr_distance<-mean_amr_distance(y, is.mic(y))#>ℹ Calculating mean AMR distance based on columns "gent" and "tobr"y[order(y$amr_distance), ]#> id amox cipr gent tobr amr_distance
-#> 2 B R 28 <=2 1 -0.5477003
-#> 3 C R 30 <=2 1 -0.5477003
-#> 4 D R 30 <=2 1 -0.5477003
-#> 8 H I 25 <=2 1 -0.5477003
-#> 9 I S 21 <=2 1 -0.5477003
-#> 5 E I 31 4 1 0.4873980
-#> 6 F S 28 4 1 0.4873980
-#> 10 J R 20 4 1 0.4873980
-#> 1 A R 26 <=2 >=2 0.6381538
-#> 7 G S 32 <=2 >=2 0.6381538
+#> 2 B R 30 <=8 4 -0.5454122
+#> 3 C I 28 <=8 4 -0.5454122
+#> 5 E I 28 <=8 4 -0.5454122
+#> 6 F S 30 <=8 4 -0.5454122
+#> 7 G I 28 <=8 4 -0.5454122
+#> 9 I R 26 <=8 4 -0.5454122
+#> 4 D I 24 <=8 >=8 0.4228336
+#> 8 H S 31 <=8 >=8 0.4228336
+#> 10 J I 28 <=8 >=8 0.4228336
+#> 1 A I 30 16 >=8 2.0039724if(require("dplyr")){y%>%
@@ -186,16 +185,16 @@
#>ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and#>"tobr"#> id amox cipr gent tobr amr_distance check_id_C
-#> 1 C R 30 <=2 1 0.14037829 0.00000000
-#> 2 D R 30 <=2 1 0.14037829 0.00000000
-#> 3 F S 28 4 1 0.06147710 0.07890119
-#> 4 J R 20 4 1 0.04738391 0.09299437
-#> 5 E I 31 4 1 0.24464016 0.10426187
-#> 6 B R 28 <=2 1 0.01826958 0.12210871
-#> 7 G S 32 <=2 >=2 0.38107241 0.24069412
-#> 8 A R 26 <=2 >=2 0.48908793 0.34870964
-#> 9 H I 25 <=2 1 -0.63923513 0.77961342
-#> 10 I S 21 <=2 1 -0.88345255 1.02383084
+#> 1 C I 28 <=8 4 -0.42682276 0.00000000
+#> 2 E I 28 <=8 4 -0.42682276 0.00000000
+#> 3 G I 28 <=8 4 -0.42682276 0.00000000
+#> 4 D I 24 <=8 >=8 -0.41644967 0.01037309
+#> 5 F S 30 <=8 4 -0.18994784 0.23687492
+#> 6 I R 26 <=8 4 -0.07077061 0.35605215
+#> 7 J I 28 <=8 >=8 0.05730016 0.48412292
+#> 8 B R 30 <=8 4 0.40297922 0.82980198
+#> 9 H S 31 <=8 >=8 0.41261253 0.83943529
+#> 10 A I 30 16 >=8 1.08474449 1.51156725if(require("dplyr")){# support for groupsexample_isolates%>%
diff --git a/reference/mean_amr_distance.md b/reference/mean_amr_distance.md
index 631249f42..af9696d08 100644
--- a/reference/mean_amr_distance.md
+++ b/reference/mean_amr_distance.md
@@ -85,31 +85,30 @@ suspicious.
sir <- random_sir(10)
sir
#> Class
-#> [1] S R I R R R R I I I
+#> [1] S I I I I I R R I R
mean_amr_distance(sir)
-#> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 0.9486833 0.9486833
-#> [7] 0.9486833 -0.9486833 -0.9486833 -0.9486833
+#> [1] -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 1.449138
+#> [8] 1.449138 -0.621059 1.449138
mic <- random_mic(10)
mic
#> Class
-#> [1] 0.032 0.032 0.125 0.25 0.016 0.004 <=0.0005 0.016
-#> [9] 0.25 0.5
+#> [1] 0.5 0.008 0.001 0.0001 0.064 0.0002 0.064 0.0001 0.032 1
mean_amr_distance(mic)
-#> [1] -0.02823448 -0.02823448 0.61480238 0.94191703 -0.35534914 -1.00957846
-#> [7] -1.99092244 -0.35534914 0.94191703 1.26903169
+#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
+#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
-#> [1] -0.02823448 -0.02823448 0.61480238 0.94191703 -0.35534914 -1.00957846
-#> [7] -1.99092244 -0.35534914 0.94191703 1.26903169
+#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
+#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440
disk <- random_disk(10)
disk
#> Class
-#> [1] 48 45 48 40 44 9 39 49 39 29
+#> [1] 38 37 42 30 40 24 45 36 49 44
mean_amr_distance(disk)
-#> [1] 0.74202711 0.49468474 0.74202711 0.08244746 0.41223728 -2.47342369
-#> [7] 0.00000000 0.82447456 0.00000000 -0.82447456
+#> [1] -0.06786705 -0.20360115 0.47506935 -1.15373986 0.20360115 -1.96814446
+#> [7] 0.88227166 -0.33933525 1.42520806 0.74653756
y <- data.frame(
id = LETTERS[1:10],
@@ -120,35 +119,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
-#> 1 A R 26 <=2 >=2
-#> 2 B R 28 <=2 1
-#> 3 C R 30 <=2 1
-#> 4 D R 30 <=2 1
-#> 5 E I 31 4 1
-#> 6 F S 28 4 1
-#> 7 G S 32 <=2 >=2
-#> 8 H I 25 <=2 1
-#> 9 I S 21 <=2 1
-#> 10 J R 20 4 1
+#> 1 A I 30 16 >=8
+#> 2 B R 30 <=8 4
+#> 3 C I 28 <=8 4
+#> 4 D I 24 <=8 >=8
+#> 5 E I 28 <=8 4
+#> 6 F S 30 <=8 4
+#> 7 G I 28 <=8 4
+#> 8 H S 31 <=8 >=8
+#> 9 I R 26 <=8 4
+#> 10 J I 28 <=8 >=8
mean_amr_distance(y)
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
-#> [1] 0.48908793 0.01826958 0.14037829 0.14037829 0.24464016 0.06147710
-#> [7] 0.38107241 -0.63923513 -0.88345255 0.04738391
+#> [1] 1.08474449 0.40297922 -0.42682276 -0.41644967 -0.42682276 -0.18994784
+#> [7] -0.42682276 0.41261253 -0.07077061 0.05730016
y$amr_distance <- mean_amr_distance(y, is.mic(y))
#> ℹ Calculating mean AMR distance based on columns "gent" and "tobr"
y[order(y$amr_distance), ]
#> id amox cipr gent tobr amr_distance
-#> 2 B R 28 <=2 1 -0.5477003
-#> 3 C R 30 <=2 1 -0.5477003
-#> 4 D R 30 <=2 1 -0.5477003
-#> 8 H I 25 <=2 1 -0.5477003
-#> 9 I S 21 <=2 1 -0.5477003
-#> 5 E I 31 4 1 0.4873980
-#> 6 F S 28 4 1 0.4873980
-#> 10 J R 20 4 1 0.4873980
-#> 1 A R 26 <=2 >=2 0.6381538
-#> 7 G S 32 <=2 >=2 0.6381538
+#> 2 B R 30 <=8 4 -0.5454122
+#> 3 C I 28 <=8 4 -0.5454122
+#> 5 E I 28 <=8 4 -0.5454122
+#> 6 F S 30 <=8 4 -0.5454122
+#> 7 G I 28 <=8 4 -0.5454122
+#> 9 I R 26 <=8 4 -0.5454122
+#> 4 D I 24 <=8 >=8 0.4228336
+#> 8 H S 31 <=8 >=8 0.4228336
+#> 10 J I 28 <=8 >=8 0.4228336
+#> 1 A I 30 16 >=8 2.0039724
if (require("dplyr")) {
y %>%
@@ -161,16 +160,16 @@ if (require("dplyr")) {
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> id amox cipr gent tobr amr_distance check_id_C
-#> 1 C R 30 <=2 1 0.14037829 0.00000000
-#> 2 D R 30 <=2 1 0.14037829 0.00000000
-#> 3 F S 28 4 1 0.06147710 0.07890119
-#> 4 J R 20 4 1 0.04738391 0.09299437
-#> 5 E I 31 4 1 0.24464016 0.10426187
-#> 6 B R 28 <=2 1 0.01826958 0.12210871
-#> 7 G S 32 <=2 >=2 0.38107241 0.24069412
-#> 8 A R 26 <=2 >=2 0.48908793 0.34870964
-#> 9 H I 25 <=2 1 -0.63923513 0.77961342
-#> 10 I S 21 <=2 1 -0.88345255 1.02383084
+#> 1 C I 28 <=8 4 -0.42682276 0.00000000
+#> 2 E I 28 <=8 4 -0.42682276 0.00000000
+#> 3 G I 28 <=8 4 -0.42682276 0.00000000
+#> 4 D I 24 <=8 >=8 -0.41644967 0.01037309
+#> 5 F S 30 <=8 4 -0.18994784 0.23687492
+#> 6 I R 26 <=8 4 -0.07077061 0.35605215
+#> 7 J I 28 <=8 >=8 0.05730016 0.48412292
+#> 8 B R 30 <=8 4 0.40297922 0.82980198
+#> 9 H S 31 <=8 >=8 0.41261253 0.83943529
+#> 10 A I 30 16 >=8 1.08474449 1.51156725
if (require("dplyr")) {
# support for groups
example_isolates %>%
diff --git a/reference/microorganisms.codes.html b/reference/microorganisms.codes.html
index 5c0414bcb..293dac696 100644
--- a/reference/microorganisms.codes.html
+++ b/reference/microorganisms.codes.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/microorganisms.groups.html b/reference/microorganisms.groups.html
index d6bab3d16..b7eab043e 100644
--- a/reference/microorganisms.groups.html
+++ b/reference/microorganisms.groups.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/microorganisms.html b/reference/microorganisms.html
index 7e78d3d75..1c02e314e 100644
--- a/reference/microorganisms.html
+++ b/reference/microorganisms.html
@@ -9,7 +9,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/mo_matching_score.html b/reference/mo_matching_score.html
index eff2d0037..678477f78 100644
--- a/reference/mo_matching_score.html
+++ b/reference/mo_matching_score.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/mo_property.html b/reference/mo_property.html
index b1b5355c2..255a003f0 100644
--- a/reference/mo_property.html
+++ b/reference/mo_property.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/mo_source.html b/reference/mo_source.html
index d5fc80b2a..fbcf05043 100644
--- a/reference/mo_source.html
+++ b/reference/mo_source.html
@@ -9,7 +9,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/pca.html b/reference/pca.html
index 7ed7b4ba0..73e3df3fe 100644
--- a/reference/pca.html
+++ b/reference/pca.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
diff --git a/reference/plot-1.png b/reference/plot-1.png
index a8d3be299..eb3a19b50 100644
Binary files a/reference/plot-1.png and b/reference/plot-1.png differ
diff --git a/reference/plot-10.png b/reference/plot-10.png
index 6d69e5bcd..9844f0d8a 100644
Binary files a/reference/plot-10.png and b/reference/plot-10.png differ
diff --git a/reference/plot-12.png b/reference/plot-12.png
index 2f5312a36..059fef1d1 100644
Binary files a/reference/plot-12.png and b/reference/plot-12.png differ
diff --git a/reference/plot-13.png b/reference/plot-13.png
index 7ed17ed7d..7961086e8 100644
Binary files a/reference/plot-13.png and b/reference/plot-13.png differ
diff --git a/reference/plot-14.png b/reference/plot-14.png
index f30d23b16..f871de373 100644
Binary files a/reference/plot-14.png and b/reference/plot-14.png differ
diff --git a/reference/plot-15.png b/reference/plot-15.png
index 8895d902d..48ffb8763 100644
Binary files a/reference/plot-15.png and b/reference/plot-15.png differ
diff --git a/reference/plot-16.png b/reference/plot-16.png
index b86cf31af..3d2dcad32 100644
Binary files a/reference/plot-16.png and b/reference/plot-16.png differ
diff --git a/reference/plot-17.png b/reference/plot-17.png
index a6f22021f..9673c8305 100644
Binary files a/reference/plot-17.png and b/reference/plot-17.png differ
diff --git a/reference/plot-18.png b/reference/plot-18.png
index 4fc82dca2..2818d41bc 100644
Binary files a/reference/plot-18.png and b/reference/plot-18.png differ
diff --git a/reference/plot-19.png b/reference/plot-19.png
index 9324a3994..c97bda444 100644
Binary files a/reference/plot-19.png and b/reference/plot-19.png differ
diff --git a/reference/plot-2.png b/reference/plot-2.png
index f4688fcf8..f75563fd9 100644
Binary files a/reference/plot-2.png and b/reference/plot-2.png differ
diff --git a/reference/plot-3.png b/reference/plot-3.png
index 3cf5b6989..0314970e7 100644
Binary files a/reference/plot-3.png and b/reference/plot-3.png differ
diff --git a/reference/plot-4.png b/reference/plot-4.png
index 41f08537c..fc8bee77e 100644
Binary files a/reference/plot-4.png and b/reference/plot-4.png differ
diff --git a/reference/plot-9.png b/reference/plot-9.png
index 228b622b5..ee21e2f71 100644
Binary files a/reference/plot-9.png and b/reference/plot-9.png differ
diff --git a/reference/plot.html b/reference/plot.html
index 23ec5fe52..68250a9e7 100644
--- a/reference/plot.html
+++ b/reference/plot.html
@@ -9,7 +9,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -189,19 +189,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
colours_SIR =c(S ="#3CAEA3", SDD ="#8FD6C4", I ="#F6D55C", R ="#ED553B"))
-theme_sir()
-
-labels_sir_count(
- position =NULL,
- x ="antibiotic",
- translate_ab ="name",
- minimum =30,
- language =get_AMR_locale(),
- combine_SI =TRUE,
- guideline =getOption("AMR_guideline", "EUCAST"),
- datalabels.size =3,
- datalabels.colour ="grey15"
-)
+theme_sir()
@@ -287,30 +275,6 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
aesthetics
Aesthetics to apply the colours to - the default is "fill" but can also be (a combination of) "alpha", "colour", "fill", "linetype", "shape" or "size".
-
-
position
-
Position adjustment of bars, either "fill", "stack" or "dodge".
-
-
-
translate_ab
-
A column name of the antimicrobials data set to translate the antibiotic abbreviations to, using ab_property().
-
-
-
minimum
-
The minimum allowed number of available (tested) isolates. Any isolate count lower than minimum will return NA with a warning. The default number of 30 isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.
-
-
-
combine_SI
-
A logical to indicate whether the 'I' category must be merged with another category, so the output only consists of susceptible vs. resistant - the default is TRUE. Following the guideline argument, the output then consists of "SI" (S+SDD+I) vs. "R" with EUCAST, and of "S" (S+SDD) vs. "IR" (I+R) with CLSI.
-
-
-
datalabels.size
-
Size of the datalabels.
-
-
-
datalabels.colour
-
Colour of the datalabels.
-
Value
@@ -345,7 +309,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
The interpretation of "I" will be named "Increased exposure" for all EUCAST guidelines since 2019, and will be named "Intermediate" in all other cases.
For interpreting MIC values as well as disk diffusion diameters, the default guideline is EUCAST 2026, unless the package option AMR_guideline is set. See as.sir() for more information.
diff --git a/reference/plot.md b/reference/plot.md
index bbfde9267..a3e3a116e 100644
--- a/reference/plot.md
+++ b/reference/plot.md
@@ -142,18 +142,6 @@ scale_sir_colours(
)
theme_sir()
-
-labels_sir_count(
- position = NULL,
- x = "antibiotic",
- translate_ab = "name",
- minimum = 30,
- language = get_AMR_locale(),
- combine_SI = TRUE,
- guideline = getOption("AMR_guideline", "EUCAST"),
- datalabels.size = 3,
- datalabels.colour = "grey15"
-)
```
## Arguments
@@ -287,41 +275,6 @@ labels_sir_count(
also be (a combination of) "alpha", "colour", "fill", "linetype",
"shape" or "size".
-- position:
-
- Position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"`.
-
-- translate_ab:
-
- A column name of the
- [antimicrobials](https://amr-for-r.org/reference/antimicrobials.md)
- data set to translate the antibiotic abbreviations to, using
- [`ab_property()`](https://amr-for-r.org/reference/ab_property.md).
-
-- minimum:
-
- The minimum allowed number of available (tested) isolates. Any isolate
- count lower than `minimum` will return `NA` with a warning. The
- default number of `30` isolates is advised by the Clinical and
- Laboratory Standards Institute (CLSI) as best practice, see *Source*.
-
-- combine_SI:
-
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- the 'I' category must be merged with another category, so the output
- only consists of susceptible vs. resistant - the default is `TRUE`.
- Following the `guideline` argument, the output then consists of `"SI"`
- (S+SDD+I) vs. `"R"` with EUCAST, and of `"S"` (S+SDD) vs. `"IR"` (I+R)
- with CLSI.
-
-- datalabels.size:
-
- Size of the datalabels.
-
-- datalabels.colour:
-
- Colour of the datalabels.
-
## Value
The
@@ -385,8 +338,9 @@ internally used by
theme](https://ggplot2.tidyverse.org/reference/theme.html) with
minimal distraction.
-- `labels_sir_count()` print datalabels on the bars with percentage and
- number of isolates, using
+- [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md)
+ print datalabels on the bars with percentage and number of isolates,
+ using
[`ggplot2::geom_text()`](https://ggplot2.tidyverse.org/reference/geom_text.html).
The interpretation of "I" will be named "Increased exposure" for all
diff --git a/reference/proportion.html b/reference/proportion.html
index 6d52feefa..75b903fb1 100644
--- a/reference/proportion.html
+++ b/reference/proportion.html
@@ -9,7 +9,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -101,7 +101,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
language =get_AMR_locale(), minimum =30, as_percent =FALSE,
- combine_SI =TRUE,
+combine_SI, confidence_level =0.95, guideline =getOption("AMR_guideline", "EUCAST"))
@@ -112,7 +112,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
language =get_AMR_locale(), minimum =30, as_percent =FALSE,
- combine_SI =TRUE,
+combine_SI, confidence_level =0.95, guideline =getOption("AMR_guideline", "EUCAST"))
@@ -139,9 +139,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
guideline
-
Either "EUCAST" (default) or "CLSI". With EUCAST, the 'I' category will be considered as susceptible (see EUCAST website), but with with CLSI, it will be considered resistant. Therefore:
You can also use e.g. proportion_R() or proportion_S() instead, to be explicit. For proportion_df(), count_df(), and sir_df(), the guideline determines how 'I' is merged when combine_SI = TRUE.
+
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). The default is the package option AMR_guideline, or "EUCAST" if it is not set. For functions that return results per category, i.e., count_df(), proportion_df(), sir_df(), ggplot_sir(), geom_sir(), and labels_sir_count(), this can also be NULL or FALSE to keep S, I, and R separate. See section Interpretation of SIR below.
ab_result
@@ -173,7 +171,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
combine_SI
-
A logical to indicate whether the 'I' category must be merged with another category, so the output only consists of susceptible vs. resistant - the default is TRUE. Following the guideline argument, the output then consists of "SI" (S+SDD+I) vs. "R" with EUCAST, and of "S" (S+SDD) vs. "IR" (I+R) with CLSI.
+
(deprecated in favour of guideline) A logical. If set, it takes precedence over guideline: TRUE merges S, SDD, and I into "SI" vs. "R", and FALSE keeps S, I, and R separate.
@@ -194,7 +192,13 @@ resistance() should be used to calculate resistance, susceptibility() should be
This AMR package follows insight; use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.
+
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
Use susceptibility() and resistance() (or count_susceptible() and count_resistant()) to follow the guideline, or e.g. proportion_SI() and proportion_R() to be explicit regardless of the guideline.
+
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
Combination Therapy
@@ -227,7 +231,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
With only_all_tested = TRUE, all these functions count the result of the combination therapy ("most_susceptible") of isolates tested for all antimicrobials, so that:
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' and 'SDD' categories are considered susceptible if combine_SI = TRUE (default), and the result is then reduced to S or R.
+
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' category is considered susceptible or not following the guideline argument ('SDD' is always considered susceptible), and the result is then reduced to S or R.
References
@@ -420,6 +424,16 @@ resistance() should be used to calculate resistance, susceptibility() should be
group_by(ward)%>%sir_df(translate =FALSE)}
+#>ℹ `proportion_df()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
+#>ℹ `sir_df()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.#># A tibble: 12 × 7#> ward antibiotic interpretation value ci_min ci_max isolates#><chr><chr><ord><dbl><dbl><dbl><int>
diff --git a/reference/proportion.md b/reference/proportion.md
index dac273726..7b292b2ca 100644
--- a/reference/proportion.md
+++ b/reference/proportion.md
@@ -56,7 +56,7 @@ proportion_df(
language = get_AMR_locale(),
minimum = 30,
as_percent = FALSE,
- combine_SI = TRUE,
+ combine_SI,
confidence_level = 0.95,
guideline = getOption("AMR_guideline", "EUCAST")
)
@@ -67,7 +67,7 @@ sir_df(
language = get_AMR_locale(),
minimum = 30,
as_percent = FALSE,
- combine_SI = TRUE,
+ combine_SI,
confidence_level = 0.95,
guideline = getOption("AMR_guideline", "EUCAST")
)
@@ -108,21 +108,20 @@ sir_df(
- guideline:
- Either `"EUCAST"` (default) or `"CLSI"`. With EUCAST, the 'I' category
- will be considered as susceptible (see [EUCAST
- website](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/)),
- but with with CLSI, it will be considered resistant. Therefore:
-
- - EUCAST: `susceptibility()` \\= \\S + \\I\\, `resistance()` \\= \\R\\
-
- - CLSI: `susceptibility()` \\= \\S + \\SDD\\, `resistance()` \\= \\I +
- \\R\\
-
- You can also use e.g. `proportion_R()` or `proportion_S()` instead, to
- be explicit. For `proportion_df()`,
- [`count_df()`](https://amr-for-r.org/reference/count.md), and
- `sir_df()`, the guideline determines how 'I' is merged when
- `combine_SI = TRUE`.
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI). The default is the package
+ option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. For functions that return results per
+ category, i.e.,
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ `proportion_df()`, `sir_df()`,
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md), and
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ this can also be `NULL` or `FALSE` to keep S, I, and R separate. See
+ section *Interpretation of SIR* below.
- ab_result:
@@ -174,12 +173,10 @@ sir_df(
- combine_SI:
- A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
- the 'I' category must be merged with another category, so the output
- only consists of susceptible vs. resistant - the default is `TRUE`.
- Following the `guideline` argument, the output then consists of `"SI"`
- (S+SDD+I) vs. `"R"` with EUCAST, and of `"S"` (S+SDD) vs. `"IR"` (I+R)
- with CLSI.
+ *(deprecated in favour of `guideline`)* A
+ [logical](https://rdrr.io/r/base/logical.html). If set, it takes
+ precedence over `guideline`: `TRUE` merges S, SDD, and I into `"SI"`
+ vs. `"R"`, and `FALSE` keeps S, I, and R separate.
## Value
@@ -240,11 +237,74 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing
categories S, I, and R
().
-This AMR package follows insight; use `susceptibility()` (equal to
-`proportion_SI()`) to determine antimicrobial susceptibility and
-[`count_susceptible()`](https://amr-for-r.org/reference/count.md) (equal
-to [`count_SI()`](https://amr-for-r.org/reference/count.md)) to count
-susceptible isolates.
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ `proportion_df()`.
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in `proportion_df()`.
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ `proportion_df()`, `sir_df()`,
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ `susceptibility()`,
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use `susceptibility()` and `resistance()` (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g. `proportion_SI()` and `proportion_R()` to
+be explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## Combination Therapy
@@ -312,9 +372,10 @@ all antimicrobials, so that:
In [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md) and
[`wisca()`](https://amr-for-r.org/reference/antibiogram.md), the result
-of the combination therapy (`"most_susceptible"`) is used, the 'I' and
-'SDD' categories are considered susceptible if `combine_SI = TRUE`
-(default), and the result is then reduced to S or R.
+of the combination therapy (`"most_susceptible"`) is used, the 'I'
+category is considered susceptible or not following the `guideline`
+argument ('SDD' is always considered susceptible), and the result is
+then reduced to S or R.
## References
@@ -511,6 +572,16 @@ if (require("dplyr")) {
group_by(ward) %>%
sir_df(translate = FALSE)
}
+#> ℹ `proportion_df()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs.
+#> I+R, or `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
+#> ℹ `sir_df()` assumes the EUCAST guideline and thus considers the 'I' category
+#> susceptible (S+SDD+I vs. R). Use `guideline = "CLSI"` for S+SDD vs. I+R, or
+#> `guideline = NULL` to keep S, I, and R separate. Set the `guideline`
+#> argument, or set the `AMR_guideline` option to change the default (see
+#> `?AMR-options`). This message is shown once per session.
#> # A tibble: 12 × 7
#> ward antibiotic interpretation value ci_min ci_max isolates
#>
diff --git a/reference/random-1.png b/reference/random-1.png
index 23fee4b5d..387c51fcd 100644
Binary files a/reference/random-1.png and b/reference/random-1.png differ
diff --git a/reference/random-2.png b/reference/random-2.png
index 2bdf64ee5..def63e30b 100644
Binary files a/reference/random-2.png and b/reference/random-2.png differ
diff --git a/reference/random.html b/reference/random.html
index 747a9acb8..ff9443e91 100644
--- a/reference/random.html
+++ b/reference/random.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -129,15 +129,16 @@
Examples
random_mic(25)#> Class <mic>
-#> [1] 0.125 0.032 0.25 0.004 0.0001 0.016 0.004 8 0.008 0.125
-#> [11] 0.0002 0.001 0.004 0.002 0.032 64 0.25 16 128 0.0002
-#> [21] 0.004 0.5 0.002 0.0005 0.064
+#> [1] 0.032 0.125 0.004 <=0.0001 <=0.0001 1 16 <=0.0001
+#> [9] 0.5 4 0.001 0.002 0.125 0.016 0.125 4
+#> [17] 0.125 0.125 0.002 0.0005 0.032 0.032 0.016 <=0.0001
+#> [25] 0.032 random_disk(25)#> Class <disk>
-#> [1] 49 44 31 11 27 33 39 24 19 43 30 44 33 31 22 13 37 19 26 29 44 12 46 18 27
+#> [1] 45 43 48 45 41 25 42 24 27 33 36 40 47 48 12 47 45 38 31 32 47 43 36 45 37random_sir(25)#> Class <sir>
-#> [1] I R I S R S R R I R R I S S S I R R S I R S R I R
+#> [1] R R S I S R I R R R I R I S R I I R R S S R R R R# add more skewedness, make more realistic by setting a bug and/or drug:disks<-random_disk(100, severity =2, mo ="Escherichia coli", ab ="CIP")
@@ -150,28 +151,28 @@
# \donttest{random_mic(25, "Klebsiella pneumoniae")# range 0.0625-64#> Class <mic>
-#> [1] 0.002 0.0002 0.004 0.064 0.0005 0.0002 1 0.016 0.0005 0.008
-#> [11] 0.008 2 0.125 0.0005 0.008 0.002 0.008 0.0005 0.002 0.064
-#> [21] 0.0002 0.004 0.0005 0.064 0.016
+#> [1] 0.064 0.004 0.008 0.5 0.008 0.001 0.125 0.064 0.5 0.004
+#> [11] 4 0.032 0.008 0.004 0.002 0.064 0.004 0.0005 0.5 0.5
+#> [21] 0.032 0.016 0.0005 0.25 0.001 random_mic(25, "Klebsiella pneumoniae", "meropenem")# range 0.0625-16#> Class <mic>
-#> [1] 1 >=2 1 1 1 1 >=2 1 1 1 1 1 1 1 >=2 1 >=2 1 1
-#> [20] 1 1 >=2 >=2 >=2 >=2
+#> [1] <=2 <=2 8 4 4 4 <=2 4 4 <=2 4 <=2 <=2 <=2 4 4 <=2 4 4
+#> [20] 4 <=2 4 <=2 8 4 random_mic(25, "Streptococcus pneumoniae", "meropenem")# range 0.0625-4#> Class <mic>
-#> [1] 0.25 <=0.125 <=0.125 0.25 0.25 <=0.125 0.25 0.25 0.25
-#> [10] 0.25 <=0.125 <=0.125 0.25 0.25 <=0.125 <=0.125 <=0.125 0.25
-#> [19] <=0.125 <=0.125 <=0.125 <=0.125 0.25 0.25 0.25
+#> [1] 0.5 0.064 0.064 0.25 0.064 0.064 0.064 0.25 <=0.032
+#> [10] 0.25 <=0.032 <=0.032 0.125 0.25 0.25 0.5 0.125 <=0.032
+#> [19] 0.5 0.25 <=0.032 0.5 0.25 0.25 <=0.032random_disk(25, "Klebsiella pneumoniae")# range 8-50#> Class <disk>
-#> [1] 13 32 34 19 19 32 31 22 19 21 27 20 21 14 34 31 29 21 29 11 23 33 34 26 19
+#> [1] 12 29 26 14 28 23 21 26 17 17 22 32 34 29 19 28 13 31 26 24 29 24 28 20 21random_disk(25, "Klebsiella pneumoniae", "ampicillin")# range 11-17#> Class <disk>
-#> [1] 15 15 17 18 13 17 18 13 11 15 16 16 17 16 13 18 16 17 16 15 15 12 18 18 16
+#> [1] 15 11 16 16 16 17 16 16 15 16 18 12 14 15 18 15 14 14 13 18 14 17 16 17 15random_disk(25, "Streptococcus pneumoniae", "ampicillin")# range 12-27#> Class <disk>
-#> [1] 21 26 23 23 27 17 24 17 24 23 23 28 27 27 24 27 18 27 27 25 24 26 22 17 26
+#> [1] 23 20 28 16 18 26 21 28 24 25 28 27 26 20 27 25 27 27 25 16 23 18 21 18 25# }
diff --git a/reference/random.md b/reference/random.md
index 9d41146d3..84171994d 100644
--- a/reference/random.md
+++ b/reference/random.md
@@ -111,15 +111,16 @@ the `skew` and `severity` arguments:
``` r
random_mic(25)
#> Class
-#> [1] 0.125 0.032 0.25 0.004 0.0001 0.016 0.004 8 0.008 0.125
-#> [11] 0.0002 0.001 0.004 0.002 0.032 64 0.25 16 128 0.0002
-#> [21] 0.004 0.5 0.002 0.0005 0.064
+#> [1] 0.032 0.125 0.004 <=0.0001 <=0.0001 1 16 <=0.0001
+#> [9] 0.5 4 0.001 0.002 0.125 0.016 0.125 4
+#> [17] 0.125 0.125 0.002 0.0005 0.032 0.032 0.016 <=0.0001
+#> [25] 0.032
random_disk(25)
#> Class
-#> [1] 49 44 31 11 27 33 39 24 19 43 30 44 33 31 22 13 37 19 26 29 44 12 46 18 27
+#> [1] 45 43 48 45 41 25 42 24 27 33 36 40 47 48 12 47 45 38 31 32 47 43 36 45 37
random_sir(25)
#> Class
-#> [1] I R I S R S R R I R R I S S S I R R S I R S R I R
+#> [1] R R S I S R I R R R I R I S R I I R R S S R R R R
# add more skewedness, make more realistic by setting a bug and/or drug:
disks <- random_disk(100, severity = 2, mo = "Escherichia coli", ab = "CIP")
@@ -132,27 +133,27 @@ plot(disks, mo = "Escherichia coli", ab = "CIP", guideline = "CLSI")
# \donttest{
random_mic(25, "Klebsiella pneumoniae") # range 0.0625-64
#> Class
-#> [1] 0.002 0.0002 0.004 0.064 0.0005 0.0002 1 0.016 0.0005 0.008
-#> [11] 0.008 2 0.125 0.0005 0.008 0.002 0.008 0.0005 0.002 0.064
-#> [21] 0.0002 0.004 0.0005 0.064 0.016
+#> [1] 0.064 0.004 0.008 0.5 0.008 0.001 0.125 0.064 0.5 0.004
+#> [11] 4 0.032 0.008 0.004 0.002 0.064 0.004 0.0005 0.5 0.5
+#> [21] 0.032 0.016 0.0005 0.25 0.001
random_mic(25, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
#> Class
-#> [1] 1 >=2 1 1 1 1 >=2 1 1 1 1 1 1 1 >=2 1 >=2 1 1
-#> [20] 1 1 >=2 >=2 >=2 >=2
+#> [1] <=2 <=2 8 4 4 4 <=2 4 4 <=2 4 <=2 <=2 <=2 4 4 <=2 4 4
+#> [20] 4 <=2 4 <=2 8 4
random_mic(25, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
#> Class
-#> [1] 0.25 <=0.125 <=0.125 0.25 0.25 <=0.125 0.25 0.25 0.25
-#> [10] 0.25 <=0.125 <=0.125 0.25 0.25 <=0.125 <=0.125 <=0.125 0.25
-#> [19] <=0.125 <=0.125 <=0.125 <=0.125 0.25 0.25 0.25
+#> [1] 0.5 0.064 0.064 0.25 0.064 0.064 0.064 0.25 <=0.032
+#> [10] 0.25 <=0.032 <=0.032 0.125 0.25 0.25 0.5 0.125 <=0.032
+#> [19] 0.5 0.25 <=0.032 0.5 0.25 0.25 <=0.032
random_disk(25, "Klebsiella pneumoniae") # range 8-50
#> Class
-#> [1] 13 32 34 19 19 32 31 22 19 21 27 20 21 14 34 31 29 21 29 11 23 33 34 26 19
+#> [1] 12 29 26 14 28 23 21 26 17 17 22 32 34 29 19 28 13 31 26 24 29 24 28 20 21
random_disk(25, "Klebsiella pneumoniae", "ampicillin") # range 11-17
#> Class
-#> [1] 15 15 17 18 13 17 18 13 11 15 16 16 17 16 13 18 16 17 16 15 15 12 18 18 16
+#> [1] 15 11 16 16 16 17 16 16 15 16 18 12 14 15 18 15 14 14 13 18 14 17 16 17 15
random_disk(25, "Streptococcus pneumoniae", "ampicillin") # range 12-27
#> Class
-#> [1] 21 26 23 23 27 17 24 17 24 23 23 28 27 27 24 27 18 27 27 25 24 26 22 17 26
+#> [1] 23 20 28 16 18 26 21 28 24 25 28 27 26 20 27 25 27 27 25 16 23 18 21 18 25
# }
```
diff --git a/reference/resistance_predict.html b/reference/resistance_predict.html
index d475e0ecc..37283747d 100644
--- a/reference/resistance_predict.html
+++ b/reference/resistance_predict.html
@@ -9,7 +9,7 @@ NOTE: These functions are deprecated and will be removed in a future version. Us
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -193,7 +193,13 @@ NOTE: These functions are deprecated and will be removed in a future version. Us
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
See also
diff --git a/reference/resistance_predict.md b/reference/resistance_predict.md
index 293666ff2..0660bb367 100644
--- a/reference/resistance_predict.md
+++ b/reference/resistance_predict.md
@@ -195,14 +195,79 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing
categories S, I, and R
().
-This AMR package follows insight; use
-[`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
-(equal to
-[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md)) to
-determine antimicrobial susceptibility and
-[`count_susceptible()`](https://amr-for-r.org/reference/count.md) (equal
-to [`count_SI()`](https://amr-for-r.org/reference/count.md)) to count
-susceptible isolates.
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## See also
diff --git a/reference/sir_combine.html b/reference/sir_combine.html
index c93721709..c54254ca2 100644
--- a/reference/sir_combine.html
+++ b/reference/sir_combine.html
@@ -17,7 +17,7 @@ See Combination Therapy below for the exact rules. The same rules are used by an
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -92,7 +92,7 @@ See Combination Therapy below for the exact rules. The same rules are used by an
guideline
-
Either "EUCAST" (default) or "CLSI", to determine whether the 'I' category is considered susceptible. This only affects isolates with a missing result for any of the antimicrobials when only_all_tested = FALSE, see Combination Therapy below. The default can be changed with the AMR_guideline option, see AMR-options.
+
A guideline name, "EUCAST" or "CLSI" (or any version thereof, e.g. "CLSI 2025"), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). This only affects isolates with a missing result for any of the antimicrobials when only_all_tested = FALSE, see Combination Therapy below. The default is the package option AMR_guideline, or "EUCAST" if it is not set. See section Interpretation of SIR below.
@@ -130,7 +130,20 @@ See Combination Therapy below for the exact rules. The same rules are used by an
With only_all_tested = TRUE, all these functions count the result of the combination therapy ("most_susceptible") of isolates tested for all antimicrobials, so that:
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' and 'SDD' categories are considered susceptible if combine_SI = TRUE (default), and the result is then reduced to S or R.
+
In antibiogram() and wisca(), the result of the combination therapy ("most_susceptible") is used, the 'I' category is considered susceptible or not following the guideline argument ('SDD' is always considered susceptible), and the result is then reduced to S or R.
In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a guideline argument for this purpose use these categories:
guideline
Susceptible
Resistant
"EUCAST"
S, SDD, I, WT
R, NWT, NS
"CLSI"
S, SDD, WT
I, R, NWT, NS
The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.
+
The guideline argument can be:
Left unset, to use the package option AMR_guideline, or "EUCAST" if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.
+
"EUCAST", or any EUCAST version such as "EUCAST 2025", to consider 'I' susceptible, e.g., to return "SI" vs. "R" in proportion_df().
+
"CLSI", or any CLSI version such as "CLSI 2025", to consider 'I' resistant, e.g., to return "S" vs. "IR" in proportion_df().
The combine_SI argument of the functions that return results per category, antibiogram(), and wisca() is deprecated in favour of guideline. If set, it is followed literally and takes precedence over guideline.
See also
@@ -144,6 +157,11 @@ See Combination Therapy below for the exact rules. The same rules are used by an
# combination therapy: is at least one of them expected to work?sir_combine(drug_a, drug_b)
+#>ℹ `sir_combine()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible, which affected the result for 'I' results combined with
+#> a missing result. Use `guideline = "CLSI"` to consider it resistant. Set the
+#> `guideline` argument, or set the `AMR_guideline` option to change the default
+#> (see `?AMR-options`). This message is shown once per session.#> Class <sir>#> [1] S S R I I <NA> <NA> SDD sir_combine(drug_a, drug_b, guideline ="CLSI")
diff --git a/reference/sir_combine.md b/reference/sir_combine.md
index 270cc7031..47b7838c4 100644
--- a/reference/sir_combine.md
+++ b/reference/sir_combine.md
@@ -62,12 +62,15 @@ sir_combine(
- guideline:
- Either `"EUCAST"` (default) or `"CLSI"`, to determine whether the 'I'
- category is considered susceptible. This only affects isolates with a
- missing result for any of the antimicrobials when
+ A guideline name, `"EUCAST"` or `"CLSI"` (or any version thereof, e.g.
+ `"CLSI 2025"`), to determine whether the 'I' category is considered
+ susceptible (EUCAST) or resistant (CLSI). This only affects isolates
+ with a missing result for any of the antimicrobials when
`only_all_tested = FALSE`, see *Combination Therapy* below. The
- default can be changed with the `AMR_guideline` option, see
- [AMR-options](https://amr-for-r.org/reference/AMR-options.md).
+ default is the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if it is not set. See section *Interpretation of SIR*
+ below.
## Value
@@ -141,9 +144,91 @@ all antimicrobials, so that:
In [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md) and
[`wisca()`](https://amr-for-r.org/reference/antibiogram.md), the result
-of the combination therapy (`"most_susceptible"`) is used, the 'I' and
-'SDD' categories are considered susceptible if `combine_SI = TRUE`
-(default), and the result is then reduced to S or R.
+of the combination therapy (`"most_susceptible"`) is used, the 'I'
+category is considered susceptible or not following the `guideline`
+argument ('SDD' is always considered susceptible), and the result is
+then reduced to S or R.
+
+## Interpretation of SIR
+
+In 2019, the European Committee on Antimicrobial Susceptibility Testing
+(EUCAST) has decided to change the definitions of susceptibility testing
+categories S, I, and R
+().
+
+In aggregated analyses, such as proportions, counts, antibiograms, and
+plots, the 'I' category must be considered either susceptible or
+resistant. In epidemiological AMR data analysis, this follows the
+guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I'
+resistant. The dose-dependent susceptibility of CLSI ('SDD') is always
+considered susceptible, as it equals what EUCAST defines as 'I'. All
+functions with a `guideline` argument for this purpose use these
+categories:
+
+| | | |
+|-------------|---------------|---------------|
+| `guideline` | Susceptible | Resistant |
+| `"EUCAST"` | S, SDD, I, WT | R, NWT, NS |
+| `"CLSI"` | S, SDD, WT | I, R, NWT, NS |
+
+The values 'WT' (wild type) and 'NWT' (non-wild type) result from
+epidemiological cut-off values (ECOFFs) instead of clinical breakpoints.
+Since they are no clinical categories, 'WT' is always considered
+susceptible and 'NWT' always resistant, regardless of the guideline. The
+value 'NS' (non-susceptible) is always considered resistant, and 'NI'
+(non-interpretable) is always considered a missing result.
+
+The `guideline` argument can be:
+
+- **Left unset**, to use the package option
+ [`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md), or
+ `"EUCAST"` if this option is not set. In the latter case, a message is
+ shown once per session (but not in R Markdown or Quarto documents);
+ set the option to silence it.
+
+- **`"EUCAST"`**, or any EUCAST version such as `"EUCAST 2025"`, to
+ consider 'I' susceptible, e.g., to return `"SI"` vs. `"R"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`"CLSI"`**, or any CLSI version such as `"CLSI 2025"`, to consider
+ 'I' resistant, e.g., to return `"S"` vs. `"IR"` in
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md).
+
+- **`NULL` or `FALSE`**, to keep S, I, and R separate. This is only
+ possible in functions that return results per category:
+ [`count_df()`](https://amr-for-r.org/reference/count.md),
+ [`proportion_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`sir_df()`](https://amr-for-r.org/reference/proportion.md),
+ [`ggplot_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`geom_sir()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ [`labels_sir_count()`](https://amr-for-r.org/reference/ggplot_sir.md),
+ and
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md).
+ Functions that return a single proportion or count, such as
+ [`susceptibility()`](https://amr-for-r.org/reference/proportion.md),
+ [`count_resistant()`](https://amr-for-r.org/reference/count.md),
+ [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md),
+ [`wisca()`](https://amr-for-r.org/reference/antibiogram.md), and
+ [`format()`](https://rdrr.io/r/base/format.html) on the result of
+ [`bug_drug_combinations()`](https://amr-for-r.org/reference/bug_drug_combinations.md),
+ require 'I' to be considered either susceptible or resistant, and
+ return an error.
+
+Use [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
+and [`resistance()`](https://amr-for-r.org/reference/proportion.md) (or
+[`count_susceptible()`](https://amr-for-r.org/reference/count.md) and
+[`count_resistant()`](https://amr-for-r.org/reference/count.md)) to
+follow the guideline, or e.g.
+[`proportion_SI()`](https://amr-for-r.org/reference/proportion.md) and
+[`proportion_R()`](https://amr-for-r.org/reference/proportion.md) to be
+explicit regardless of the guideline.
+
+The `combine_SI` argument of the functions that return results per
+category,
+[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md), and
+[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) is
+deprecated in favour of `guideline`. If set, it is followed literally
+and takes precedence over `guideline`.
## See also
@@ -162,6 +247,11 @@ drug_b <- as.sir(c("R", "S", "R", "R", NA, NA, NA, "I"))
# combination therapy: is at least one of them expected to work?
sir_combine(drug_a, drug_b)
+#> ℹ `sir_combine()` assumes the EUCAST guideline and thus considers the 'I'
+#> category susceptible, which affected the result for 'I' results combined with
+#> a missing result. Use `guideline = "CLSI"` to consider it resistant. Set the
+#> `guideline` argument, or set the `AMR_guideline` option to change the default
+#> (see `?AMR-options`). This message is shown once per session.
#> Class
#> [1] S S R I I SDD
sir_combine(drug_a, drug_b, guideline = "CLSI")
diff --git a/reference/skewness.html b/reference/skewness.html
index 5fa7a85f4..d6dcfb4f4 100644
--- a/reference/skewness.html
+++ b/reference/skewness.html
@@ -9,7 +9,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
AMR (for R)
- 3.0.1.9137
+ 3.0.1.9138
@@ -90,7 +90,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu