@@ -146,21 +146,21 @@ make the structure of your data generally look like this:
-
2025-02-11
+
2025-02-13
abcd
Escherichia coli
S
S
-
2025-02-11
+
2025-02-13
abcd
Escherichia coli
S
R
-
2025-02-11
+
2025-02-13
efgh
Escherichia coli
R
diff --git a/articles/AMR_for_Python.html b/articles/AMR_for_Python.html
index 31b91ad84..5e6af0db5 100644
--- a/articles/AMR_for_Python.html
+++ b/articles/AMR_for_Python.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/articles/AMR_with_tidymodels.html b/articles/AMR_with_tidymodels.html
index b7fc76811..f10c2ac3c 100644
--- a/articles/AMR_with_tidymodels.html
+++ b/articles/AMR_with_tidymodels.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -129,7 +129,7 @@ package.
# Load required librarieslibrary(tidymodels)# For machine learning workflows, and data manipulation (dplyr, tidyr, ...)#> ── Attaching packages ────────────────────────────────────── tidymodels 1.2.0 ──
-#> ✔broom 1.0.7 ✔recipes 1.1.0
+#> ✔broom 1.0.7 ✔recipes 1.1.1#> ✔dials 1.3.0 ✔rsample 1.2.1#> ✔dplyr 1.1.4 ✔tibble 3.2.1#> ✔ggplot2 3.5.1 ✔tidyr 1.3.1
@@ -142,7 +142,7 @@ package.
#> ✖dplyr::filter() masks stats::filter()#> ✖dplyr::lag() masks stats::lag()#> ✖recipes::step() masks stats::step()
-#> • Dig deeper into tidy modeling with R at https://www.tmwr.org
+#> • Learn how to get started at https://www.tidymodels.org/start/library(AMR)# For AMR data analysis# Load the example_isolates dataset
diff --git a/articles/EUCAST.html b/articles/EUCAST.html
index 711d31889..8d021f4ef 100644
--- a/articles/EUCAST.html
+++ b/articles/EUCAST.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/articles/MDR.html b/articles/MDR.html
index f5c89764c..4994da7e5 100644
--- a/articles/MDR.html
+++ b/articles/MDR.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/articles/PCA.html b/articles/PCA.html
index 065a2fbc5..18a9d30f6 100644
--- a/articles/PCA.html
+++ b/articles/PCA.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/articles/WHONET.html b/articles/WHONET.html
index 1fe5f806f..314c1204d 100644
--- a/articles/WHONET.html
+++ b/articles/WHONET.html
@@ -31,7 +31,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -310,6 +310,9 @@ using the included ggplot_sir()group_by(Country)%>%select(Country, AMP_ND2, AMC_ED20, CAZ_ED10, CIP_ED5)%>%ggplot_sir(translate_ab ="ab", facet ="Country", datalabels =FALSE)
+
#> Warning: Using scale_sir_colours() for the fill aesthetic has been superseded by
+#> scale_fill_sir(), please use that instead. This warning will be shown
+#> once per session.
diff --git a/reference/antibiogram.html b/reference/antibiogram.html
index 1c39670a2..81b5475a2 100644
--- a/reference/antibiogram.html
+++ b/reference/antibiogram.html
@@ -9,7 +9,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/antibiotics.html b/reference/antibiotics.html
index 98bd7554c..45d7f0b3d 100644
--- a/reference/antibiotics.html
+++ b/reference/antibiotics.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/antimicrobial_class_selectors.html b/reference/antimicrobial_class_selectors.html
index 889524269..f3cf27d43 100644
--- a/reference/antimicrobial_class_selectors.html
+++ b/reference/antimicrobial_class_selectors.html
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %>%
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.ab.html b/reference/as.ab.html
index 827cb9c36..86ee0f57e 100644
--- a/reference/as.ab.html
+++ b/reference/as.ab.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.av.html b/reference/as.av.html
index af0c6edc6..8a710f8b6 100644
--- a/reference/as.av.html
+++ b/reference/as.av.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.disk.html b/reference/as.disk.html
index 7e47d275c..72c866e1f 100644
--- a/reference/as.disk.html
+++ b/reference/as.disk.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.mic.html b/reference/as.mic.html
index 9f37b7cf4..84fe4bebf 100644
--- a/reference/as.mic.html
+++ b/reference/as.mic.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.mo.html b/reference/as.mo.html
index 51b9f48ed..7dacea1a5 100644
--- a/reference/as.mo.html
+++ b/reference/as.mo.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/as.sir.html b/reference/as.sir.html
index 918387f21..3a1b1b490 100644
--- a/reference/as.sir.html
+++ b/reference/as.sir.html
@@ -21,7 +21,7 @@ All breakpoints used for interpretation are available in our clinical_breakpoint
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -782,16 +782,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#># A tibble: 57 × 16#> datetime index ab_given mo_given host_given ab mo #>*<dttm><int><chr><chr><chr><ab><mo>
-#> 1 2025-02-11 16:28:00 4 AMX B_STRPT… human AMX B_STRPT_PNMN
-#> 2 2025-02-11 16:28:07 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
-#> 3 2025-02-11 16:28:07 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
-#> 4 2025-02-11 16:28:08 4 genta Escheri… cattle GEN B_ESCHR_COLI
-#> 5 2025-02-11 16:28:08 4 genta Escheri… cattle GEN B_ESCHR_COLI
-#> 6 2025-02-11 16:28:00 3 AMX B_STRPT… human AMX B_STRPT_PNMN
-#> 7 2025-02-11 16:28:07 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
-#> 8 2025-02-11 16:28:07 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
-#> 9 2025-02-11 16:28:08 3 tobra Escheri… horses TOB B_ESCHR_COLI
-#>10 2025-02-11 16:28:08 3 tobra Escheri… horses TOB B_ESCHR_COLI
+#> 1 2025-02-13 18:54:33 4 AMX B_STRPT… human AMX B_STRPT_PNMN
+#> 2 2025-02-13 18:54:40 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
+#> 3 2025-02-13 18:54:40 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
+#> 4 2025-02-13 18:54:41 4 genta Escheri… cattle GEN B_ESCHR_COLI
+#> 5 2025-02-13 18:54:41 4 genta Escheri… cattle GEN B_ESCHR_COLI
+#> 6 2025-02-13 18:54:33 3 AMX B_STRPT… human AMX B_STRPT_PNMN
+#> 7 2025-02-13 18:54:40 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
+#> 8 2025-02-13 18:54:40 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
+#> 9 2025-02-13 18:54:41 3 tobra Escheri… horses TOB B_ESCHR_COLI
+#>10 2025-02-13 18:54:41 3 tobra Escheri… horses TOB B_ESCHR_COLI #># ℹ 47 more rows#># ℹ 9 more variables: host <chr>, method <chr>, input <dbl>, outcome <sir>,#># notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
diff --git a/reference/atc_online.html b/reference/atc_online.html
index 3453447a6..954a143f1 100644
--- a/reference/atc_online.html
+++ b/reference/atc_online.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/av_from_text.html b/reference/av_from_text.html
index 35df9946b..cb9ffcfed 100644
--- a/reference/av_from_text.html
+++ b/reference/av_from_text.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/av_property.html b/reference/av_property.html
index 0f1d803a3..0e2a8185e 100644
--- a/reference/av_property.html
+++ b/reference/av_property.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/availability.html b/reference/availability.html
index c17707db4..e3d5a6ba5 100644
--- a/reference/availability.html
+++ b/reference/availability.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/bug_drug_combinations.html b/reference/bug_drug_combinations.html
index 9d5a722c2..2b3194ba4 100644
--- a/reference/bug_drug_combinations.html
+++ b/reference/bug_drug_combinations.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/clinical_breakpoints.html b/reference/clinical_breakpoints.html
index fda529ab2..839a9b92c 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)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/count.html b/reference/count.html
index d515db3f6..3b0b2c2d8 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)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/custom_eucast_rules.html b/reference/custom_eucast_rules.html
index 6874b0861..e681e6d90 100644
--- a/reference/custom_eucast_rules.html
+++ b/reference/custom_eucast_rules.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/dosage.html b/reference/dosage.html
index c0aea5f79..a2c7f8731 100644
--- a/reference/dosage.html
+++ b/reference/dosage.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/eucast_rules.html b/reference/eucast_rules.html
index 7a4a31736..2ad84dbef 100644
--- a/reference/eucast_rules.html
+++ b/reference/eucast_rules.html
@@ -9,7 +9,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/example_isolates.html b/reference/example_isolates.html
index 1439a9327..25a388ff8 100644
--- a/reference/example_isolates.html
+++ b/reference/example_isolates.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/example_isolates_unclean.html b/reference/example_isolates_unclean.html
index 889db162e..160da192f 100644
--- a/reference/example_isolates_unclean.html
+++ b/reference/example_isolates_unclean.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/export_ncbi_biosample.html b/reference/export_ncbi_biosample.html
index 6a2885a3c..759d91f9f 100644
--- a/reference/export_ncbi_biosample.html
+++ b/reference/export_ncbi_biosample.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/first_isolate.html b/reference/first_isolate.html
index f76f9ff33..cb83d6865 100644
--- a/reference/first_isolate.html
+++ b/reference/first_isolate.html
@@ -9,7 +9,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/g.test.html b/reference/g.test.html
index 8e12a793d..b4aef49ba 100644
--- a/reference/g.test.html
+++ b/reference/g.test.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/get_episode.html b/reference/get_episode.html
index 87a5ba2f8..493a6a71b 100644
--- a/reference/get_episode.html
+++ b/reference/get_episode.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/ggplot_pca.html b/reference/ggplot_pca.html
index 4649f386b..5d44fa648 100644
--- a/reference/ggplot_pca.html
+++ b/reference/ggplot_pca.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/ggplot_sir.html b/reference/ggplot_sir.html
index 2cb24ee4e..dd5a42763 100644
--- a/reference/ggplot_sir.html
+++ b/reference/ggplot_sir.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -187,7 +187,7 @@
ggplot(df)+geom_sir()+scale_y_percent()+
-scale_sir_colours()+
+scale_sir_colours(aesthetics ="fill")+labels_sir_count()+theme_sir()}
@@ -236,7 +236,8 @@
)%>%ggplot()+geom_col(aes(x =x, y =y, fill =z))+
-scale_sir_colours(Value4 ="S", Value5 ="I", Value6 ="R")
+scale_sir_colours(aesthetics ="fill",
+ Value4 ="S", Value5 ="I", Value6 ="R")}if(require("ggplot2")&&require("dplyr")){
diff --git a/reference/guess_ab_col.html b/reference/guess_ab_col.html
index 1311fe689..e2a383a0a 100644
--- a/reference/guess_ab_col.html
+++ b/reference/guess_ab_col.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/index.html b/reference/index.html
index 3e6f40d71..516ad9a92 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -282,7 +282,7 @@
diff --git a/reference/intrinsic_resistant.html b/reference/intrinsic_resistant.html
index 784ba558b..7cb9cd2d3 100644
--- a/reference/intrinsic_resistant.html
+++ b/reference/intrinsic_resistant.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/italicise_taxonomy.html b/reference/italicise_taxonomy.html
index 168d7a48d..59ec4fbf9 100644
--- a/reference/italicise_taxonomy.html
+++ b/reference/italicise_taxonomy.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/join.html b/reference/join.html
index 8cec17519..f340332ad 100644
--- a/reference/join.html
+++ b/reference/join.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/key_antimicrobials.html b/reference/key_antimicrobials.html
index a63436960..90590eb0a 100644
--- a/reference/key_antimicrobials.html
+++ b/reference/key_antimicrobials.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/kurtosis.html b/reference/kurtosis.html
index b24af1a23..1541c8b31 100644
--- a/reference/kurtosis.html
+++ b/reference/kurtosis.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/like.html b/reference/like.html
index d5a9f62e9..a62880414 100644
--- a/reference/like.html
+++ b/reference/like.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/mdro.html b/reference/mdro.html
index 5f9bfdbef..d4f7b6862 100644
--- a/reference/mdro.html
+++ b/reference/mdro.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/mean_amr_distance.html b/reference/mean_amr_distance.html
index 80ad76c68..62a48ba92 100644
--- a/reference/mean_amr_distance.html
+++ b/reference/mean_amr_distance.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/microorganisms.codes.html b/reference/microorganisms.codes.html
index 10f728cef..6ed7be353 100644
--- a/reference/microorganisms.codes.html
+++ b/reference/microorganisms.codes.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/microorganisms.groups.html b/reference/microorganisms.groups.html
index 20adf1136..ce956f15d 100644
--- a/reference/microorganisms.groups.html
+++ b/reference/microorganisms.groups.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/microorganisms.html b/reference/microorganisms.html
index ffb7389f8..fbecefd5c 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)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/mo_matching_score.html b/reference/mo_matching_score.html
index d0b4ab5e2..04a9e78ff 100644
--- a/reference/mo_matching_score.html
+++ b/reference/mo_matching_score.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/mo_property.html b/reference/mo_property.html
index 68f74e222..dd4e1e33e 100644
--- a/reference/mo_property.html
+++ b/reference/mo_property.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/mo_source.html b/reference/mo_source.html
index c055fbe58..cc4e228c0 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)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/pca.html b/reference/pca.html
index d57763f1b..21b0ac0e7 100644
--- a/reference/pca.html
+++ b/reference/pca.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/plot-15.png b/reference/plot-15.png
index 4da34f2ca..5a514c5bf 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 4b437815c..4da34f2ca 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 879422043..4b437815c 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 757b104c2..879422043 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 231b81794..757b104c2 100644
Binary files a/reference/plot-19.png and b/reference/plot-19.png differ
diff --git a/reference/plot-20.png b/reference/plot-20.png
index 8c67ffa28..231b81794 100644
Binary files a/reference/plot-20.png and b/reference/plot-20.png differ
diff --git a/reference/plot-21.png b/reference/plot-21.png
new file mode 100644
index 000000000..8c67ffa28
Binary files /dev/null and b/reference/plot-21.png differ
diff --git a/reference/plot.html b/reference/plot.html
index 2efd83de7..62cf78532 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)
- 2.1.1.9144
+ 2.1.1.9146
@@ -67,6 +67,18 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
scale_fill_mic(keep_operators ="edges", mic_range =NULL, ...)
+scale_x_sir(colours_SIR =c("#3CAEA3", "#F6D55C", "#ED553B"),
+ language =get_AMR_locale(), eucast_I =getOption("AMR_guideline",
+"EUCAST")=="EUCAST", ...)
+
+scale_colour_sir(colours_SIR =c("#3CAEA3", "#F6D55C", "#ED553B"),
+ language =get_AMR_locale(), eucast_I =getOption("AMR_guideline",
+"EUCAST")=="EUCAST", ...)
+
+scale_fill_sir(colours_SIR =c("#3CAEA3", "#F6D55C", "#ED553B"),
+ language =get_AMR_locale(), eucast_I =getOption("AMR_guideline",
+"EUCAST")=="EUCAST", ...)
+
# S3 method for class 'mic'plot(x, mo =NULL, ab =NULL, guideline ="EUCAST", main =deparse(substitute(x)), ylab =translate_AMR("Frequency", language
@@ -87,9 +99,6 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
include_PKPD =getOption("AMR_include_PKPD", TRUE), breakpoint_type =getOption("AMR_breakpoint_type", "human"), ...)
-# S3 method for class 'mic'
-fortify(object, ...)
-
# S3 method for class 'disk'plot(x, main =deparse(substitute(x)), ylab =translate_AMR("Frequency", language =language),
@@ -109,9 +118,6 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
include_PKPD =getOption("AMR_include_PKPD", TRUE), breakpoint_type =getOption("AMR_breakpoint_type", "human"), ...)
-# S3 method for class 'disk'
-fortify(object, ...)
-
# S3 method for class 'sir'plot(x, ylab =translate_AMR("Percentage", language =language), xlab =translate_AMR("Antimicrobial Interpretation", language =
@@ -125,16 +131,13 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
colours_SIR =c("#3CAEA3", "#F6D55C", "#ED553B"), language =get_AMR_locale(), ...)
-# S3 method for class 'sir'
-fortify(object, ...)
-
facet_sir(facet =c("interpretation", "antibiotic"), nrow =NULL)scale_y_percent(breaks =function(x)seq(0, max(x, na.rm =TRUE), 0.1), limits =c(0, NA))
-scale_sir_colours(..., aesthetics ="fill", colours_SIR =c("#3CAEA3",
-"#F6D55C", "#ED553B"))
+scale_sir_colours(..., aesthetics, colours_SIR =c("#3CAEA3", "#F6D55C",
+"#ED553B"))theme_sir()
@@ -159,6 +162,18 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
arguments passed on to methods
+
colours_SIR
+
colours to use for filling in the bars, must be a vector of three values (in the order S, I and R). The default colours are colour-blind friendly.
+
+
+
language
+
language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant' - the default is system language (see get_AMR_locale()) and can be overwritten by setting the package option AMR_locale, e.g. options(AMR_locale = "de"), see translate. Use language = NULL to prevent translation.
+
+
+
eucast_I
+
a logical to indicate whether the 'I' must be interpreted as "Susceptible, under increased exposure". Will be TRUE if the default AMR interpretation guideline is set to EUCAST (which is the default). With FALSE, it will be interpreted as "Intermediate".
@@ -183,14 +198,6 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
axis title
-
colours_SIR
-
colours to use for filling in the bars, must be a vector of three values (in the order S, I and R). The default colours are colour-blind friendly.
-
-
-
language
-
language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant' - the default is system language (see get_AMR_locale()) and can be overwritten by setting the package option AMR_locale, e.g. options(AMR_locale = "de"), see translate. Use language = NULL or language = "" to prevent translation.
-
-
expand
a logical to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled.
@@ -250,22 +257,36 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
Value
The autoplot() functions return a ggplot model that is extendible with any ggplot2 function.
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, supported guidelines to be used as input for the guideline argument are: "EUCAST 2024", "EUCAST 2023", "EUCAST 2022", "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2024", "CLSI 2023", "CLSI 2022", "CLSI 2021", "CLSI 2020", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", and "CLSI 2011".
-
Simply using "CLSI" or "EUCAST" as input will automatically select the latest version of that guideline.
+
+
+
The scale_*_mic() Functions
+
+
+
The functions scale_x_mic(), scale_y_mic(), scale_colour_mic(), and scale_fill_mic() functions allow to plot the mic class (MIC values) on a continuous scale. They allow to rescale the MIC range, and retain the signs in MIC values if desired. Missing intermediate log2 levels will be plotted too.
+
+
+
+
The scale_*_sir() Functions
+
+
+
The functions scale_x_sir(), scale_colour_sir(), and scale_fill_sir() functions allow to plot the sir class (S/I/R values). They can translate the S/I/R values to any of the 20 supported languages, and set colour-blind friendly colours to the colour and fill aesthetics.
+
+
+
Additional ggplot2 Functions
-
This package contains several functions that extend the ggplot2 package, to help in visualising AMR data results. All these functions are internally used by ggplot_sir() too.
facet_sir() creates 2d plots (at default based on S/I/R) using ggplot2::facet_wrap().
+
This package contains more functions that extend the ggplot2 package, to help in visualising AMR data results. All these functions are internally used by ggplot_sir() too.
facet_sir() creates 2d plots (at default based on S/I/R) using ggplot2::facet_wrap().
scale_sir_colours() sets colours to the bars (green for S, yellow for I, and red for R). Has 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.
+
scale_sir_colours() allows to set colours to any aesthetic, even for shape or linetype.
theme_sir() is a [ggplot2 theme][ggplot2::theme() with minimal distraction.
labels_sir_count() print datalabels on the bars with percentage and number of isolates, using ggplot2::geom_text().
-
+
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, supported guidelines to be used as input for the guideline argument are: "EUCAST 2024", "EUCAST 2023", "EUCAST 2022", "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2024", "CLSI 2023", "CLSI 2022", "CLSI 2021", "CLSI 2020", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", and "CLSI 2011". Simply using "CLSI" or "EUCAST" as input will automatically select the latest version of that guideline.
+
@@ -275,6 +296,9 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
some_disk_values<-random_disk(size =100, mo ="Escherichia coli", ab ="cipro")some_sir_values<-random_sir(50, prob_SIR =c(0.55, 0.05, 0.30))
+
+# Plotting using base R's plot() ---------------------------------------
+plot(some_mic_values)plot(some_disk_values)
@@ -327,8 +351,10 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
}
+# Plotting using scale_y_mic() -----------------------------------------some_groups<-sample(LETTERS[1:5], 20, replace =TRUE)
+if(require("ggplot2")){ggplot(data.frame(mic =some_mic_values, group =some_groups),
@@ -348,8 +374,10 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
}
+# Plotting using scale_fill_mic() -----------------------------------------some_counts<-as.integer(runif(20, 5, 50))
+if(require("ggplot2")){ggplot(data.frame(mic =some_mic_values, group =some_groups,
@@ -360,19 +388,69 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
}
-# Auto plotting --------------------------------------------------------
+# Plotting using scale_x_sir() -----------------------------------------
+if(require("ggplot2")){
+ggplot(data.frame(x =c("I", "R", "S"),
+ y =c(45,323, 573)),
+aes(x, y))+
+geom_col()+
+scale_x_sir()
+}
+#>Error: Apply scale_x_sir() to a variable of class 'sir', see ?as.sir.
+
+
+# Plotting using scale_y_mic() and scale_colour_sir() ------------------
+if(require("ggplot2")){
+plain<-ggplot(data.frame(mic =some_mic_values,
+ group =some_groups,
+ sir =as.sir(some_mic_values,
+ mo ="E. coli",
+ ab ="cipro")),
+aes(x =group, y =mic, colour =sir))+
+theme_minimal()+
+geom_boxplot(fill =NA, colour ="grey")+
+geom_jitter(width =0.25)
+
+plain
+}
+#>
+#>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
+#> all the details of the breakpoint interpretations.
+#>
+#>Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), EUCAST 2024...
+#> NOTE
+#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
+
+if(require("ggplot2")){
+# and now with our MIC and SIR scale functions:
+plain+
+scale_y_mic()+
+scale_colour_sir()
+}
+#>Error: Apply scale_colour_sir() to a variable of class 'sir', see ?as.sir.
+if(require("ggplot2")){
+plain+
+scale_y_mic(mic_range =c(0.005, 32), name ="Our MICs!")+
+scale_colour_sir(language ="el", eucast_I =FALSE,
+ name ="In Greek!")
+}
+#>Error: Apply scale_colour_sir() to a variable of class 'sir', see ?as.sir.
+
+
+# Plotting using ggplot2's autoplot() ----------------------------------if(require("ggplot2")){autoplot(some_mic_values)}
-
+if(require("ggplot2")){autoplot(some_disk_values, mo ="Escherichia coli", ab ="cipro")}
-
+if(require("ggplot2")){autoplot(some_sir_values)}
-
+
+# Plotting using scale_y_percent() -------------------------------------if(require("ggplot2")){
@@ -392,9 +470,9 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
limits =c(0, 1))+theme_sir()}
-
+# }
diff --git a/reference/proportion.html b/reference/proportion.html
index 8a9ddb0a9..0f7e7124b 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)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/random.html b/reference/random.html
index 34692929f..df2d60b6b 100644
--- a/reference/random.html
+++ b/reference/random.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
@@ -99,43 +99,42 @@
Examples
random_mic(25)#> Class 'mic'
-#> [1] 32 2 0.002 128 128 0.0625 32 4 128 0.0625
-#> [11] 0.5 0.025 256 4 16 0.025 0.025 4 256 0.5
-#> [21] 8 4 0.005 4 0.01
+#> [1] 128 0.0625 32 4 128 0.0625 0.5 0.025 256 4
+#> [11] 16 0.025 0.025 4 256 0.5 8 4 0.005 4
+#> [21] 0.01 0.0625 0.025 64 4 random_disk(25)#> Class 'disk'
-#> [1] 11 10 21 42 49 34 17 35 45 37 36 16 17 25 47 47 41 47 10 6 31 33 37 29 14
+#> [1] 35 45 37 36 16 17 25 47 47 40 50 10 6 31 33 37 29 14 33 41 31 7 13 46 42random_sir(25)#> Class 'sir'
-#> [1] R S S I I S S S I R S R S I S I S S I S I S R S R
+#> [1] S R S I S I S S I S I S R S R R R I S S I S S R S# \donttest{# make the random generation more realistic by setting a bug and/or drug:random_mic(25, "Klebsiella pneumoniae")# range 0.0625-64#> Class 'mic'
-#> [1] 0.25 0.5 2 32 0.005 0.025 0.5 >=128 0.0625 0.25
-#> [11] 0.0625 4 4 8 0.001 16 >=128 0.25 0.025 0.025
-#> [21] 16 0.0625 0.0625 >=128 0.125
+#> [1] 4 0.0625 0.25 0.0625 16 4 1 4 1
+#> [10] 8 0.5 <=0.001 8 16 <=0.001 4 0.25 0.025
+#> [19] 16 0.005 0.025 16 0.0625 0.0625 <=0.001random_mic(25, "Klebsiella pneumoniae", "meropenem")# range 0.0625-16#> Class 'mic'
-#> [1] 1 1 16 4 32 0.5 8 8 8 8
-#> [11] 0.5 <=0.25 2 32 0.5 4 32 0.5 <=0.25 16
-#> [21] 2 8 <=0.25 8 8
+#> [1] 2 2 2 32 8 >=64 1 16 16 16 16 1 0.5 4 >=64
+#> [16] 1 8 >=64 1 0.5 32 4 16 0.5 16 random_mic(25, "Streptococcus pneumoniae", "meropenem")# range 0.0625-4#> Class 'mic'
-#> [1] 2 2 0.125 8 4 2 0.125 2 0.5 0.5 16 1
-#> [13] 1 0.25 0.25 0.25 2 8 0.125 0.125 2 8 4 16
-#> [25] 2
+#> [1] 4 0.5 0.5 0.5 0.025 2 1 0.5 0.025 0.5
+#> [11] 0.125 0.125 4 0.25 0.25 0.0625 0.0625 0.0625 0.5 2
+#> [21] 0.025 0.025 0.5 2 1 random_disk(25, "Klebsiella pneumoniae")# range 8-50#> Class 'disk'
-#> [1] 25 17 40 14 34 35 40 45 18 35 24 42 48 45 19 31 45 9 35 26 30 26 48 10 15
+#> [1] 42 21 25 17 47 14 34 35 40 45 18 35 24 40 48 45 19 31 45 9 35 26 30 26 48random_disk(25, "Klebsiella pneumoniae", "ampicillin")# range 11-17#> Class 'disk'
-#> [1] 13 17 14 11 14 14 14 17 17 17 14 17 15 12 12 12 15 16 17 14 16 14 13 12 16
+#> [1] 16 13 13 17 14 11 14 14 14 17 17 17 14 17 15 12 12 12 15 16 17 14 16 14 13random_disk(25, "Streptococcus pneumoniae", "ampicillin")# range 12-27#> Class 'disk'
-#> [1] 26 20 18 27 18 15 18 17 16 20 24 21 25 21 25 18 23 25 17 24 17 16 20 18 25
+#> [1] 24 20 26 20 18 27 18 15 18 17 16 20 24 21 25 21 25 18 23 25 17 24 17 16 20# }
diff --git a/reference/resistance_predict.html b/reference/resistance_predict.html
index 600c4de1c..d0b3ab7d9 100644
--- a/reference/resistance_predict.html
+++ b/reference/resistance_predict.html
@@ -7,7 +7,7 @@
AMR (for R)
- 2.1.1.9144
+ 2.1.1.9146
diff --git a/reference/fortify.disk.html b/reference/scale_colour_sir.html
similarity index 100%
rename from reference/fortify.disk.html
rename to reference/scale_colour_sir.html
diff --git a/reference/fortify.mic.html b/reference/scale_fill_sir.html
similarity index 100%
rename from reference/fortify.mic.html
rename to reference/scale_fill_sir.html
diff --git a/reference/fortify.sir.html b/reference/scale_x_sir.html
similarity index 100%
rename from reference/fortify.sir.html
rename to reference/scale_x_sir.html
diff --git a/reference/skewness.html b/reference/skewness.html
index 490fc8c1b..6a8e821bc 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)
- 2.1.1.9144
+ 2.1.1.9146
@@ -89,7 +89,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu