diff --git a/DESCRIPTION b/DESCRIPTION
index cf12e989..8fcb3350 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: AMR
-Version: 1.8.2.9142
-Date: 2023-02-23
+Version: 1.8.2.9143
+Date: 2023-02-24
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by
diff --git a/NEWS.md b/NEWS.md
index 2633fd16..1a772e11 100755
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# AMR 1.8.2.9142
+# AMR 1.8.2.9143
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
diff --git a/R/aa_helper_pm_functions.R b/R/aa_helper_pm_functions.R
index 2ad3ea12..800976ab 100755
--- a/R/aa_helper_pm_functions.R
+++ b/R/aa_helper_pm_functions.R
@@ -988,7 +988,7 @@ pm_summarise.default <- function(.data, ...) {
if (is.list(x_res)) I(x_res) else x_res
}
)
- res <- as.data.frame(res)
+ res <- as.data.frame(res, stringsAsFactors = FALSE)
fn_names <- names(fns)
colnames(res) <- if (is.null(fn_names)) fns else fn_names
if (pm_groups_exist) res <- cbind(group, res, row.names = NULL)
diff --git a/R/antibiogram.R b/R/antibiogram.R
index 82e4c699..b6c3ef84 100755
--- a/R/antibiogram.R
+++ b/R/antibiogram.R
@@ -49,7 +49,11 @@
#' @details This function returns a table with values between 0 and 100 for *susceptibility*, not resistance.
#'
#' **Remember that you should filter your data to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set with one of the four available algorithms.
+#'
+#' All types of antibiograms as listed below can be plotted (using [ggplot2::autoplot()] or base \R [plot()]/[barplot()]). The `antibiogram` object can also be used directly in R Markdown / Quarto (i.e., `knitr`) for reports. In this case, [knitr::kable()] will be applied automatically and microorganism names will even be printed in italics at default (see argument `italicise`). You can also use functions from specific 'table reporting' packages to transform the output of [antibiogram()] to your needs, e.g. with [`as_flextable()`][flextable::as_flextable()] or [`gt()`][gt::gt()].
#'
+#' ### Antibiogram Types
+#'
#' There are four antibiogram types, as proposed by Klinker *et al.* (2021, \doi{10.1177/20499361211011373}), and they are all supported by [antibiogram()]:
#'
#' 1. **Traditional Antibiogram**
@@ -103,8 +107,6 @@
#' "Study Group", "Control Group"))
#' ```
#'
-#' All types of antibiograms can be generated with the functions as described on this page, and can be plotted (using [ggplot2::autoplot()] or base \R [plot()]/[barplot()]) or directly used into R Markdown / Quarto formats for reports (in the last case, [knitr::kable()] will be applied automatically). Use functions from specific 'table reporting' packages to transform the output of [antibiogram()] to your needs, e.g. `flextable::as_flextable()` or `gt::gt()`.
-#'
#' Note that for combination antibiograms, it is important to realise that susceptibility can be calculated in two ways, which can be set with the `only_all_tested` argument (default is `FALSE`). See this example for two antibiotics, Drug A and Drug B, about how [antibiogram()] works to calculate the %SI:
#'
#' ```
@@ -125,6 +127,7 @@
#' - - - -
#' --------------------------------------------------------------------
#' ```
+#'
#' @source
#' * Klinker KP *et al.* (2021). **Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms**. *Therapeutic Advances in Infectious Disease*, May 5;8:20499361211011373; \doi{10.1177/20499361211011373}
#' * Barbieri E *et al.* (2021). **Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach** *Antimicrobial Resistance & Infection Control* May 1;10(1):74; \doi{10.1186/s13756-021-00939-2}
@@ -208,6 +211,7 @@
#' "WISCA Group 1", "WISCA Group 2"
#' )
#' )
+#'
#'
#' # Print the output for R Markdown / Quarto -----------------------------
#'
@@ -504,6 +508,7 @@ antibiogram <- function(x,
out <- as_original_data_class(new_df, class(x), extra_class = "antibiogram")
rownames(out) <- NULL
structure(out,
+ has_syndromic_group = has_syndromic_group,
long = long,
combine_SI = combine_SI
)
@@ -578,39 +583,25 @@ autoplot.antibiogram <- function(object, ...) {
}
# will be exported in zzz.R
-#' @param italicise a [logical] to indicate whether the microorganism names in the [knitr][knitr::kable()] table should be made italic, using [italicise_taxonomy()]. This only works when the output format is markdown, such as in HTML output.
+#' @method knit_print antibiogram
+#' @param italicise a [logical] to indicate whether the microorganism names in the [knitr][knitr::kable()] table should be made italic, using [italicise_taxonomy()].
#' @param na character to use for showing `NA` values
#' @rdname antibiogram
knit_print.antibiogram <- function(x, italicise = TRUE, na = getOption("knitr.kable.NA", default = ""), ...) {
stop_ifnot_installed("knitr")
meet_criteria(italicise, allow_class = "logical", has_length = 1)
meet_criteria(na, allow_class = "character", has_length = 1, allow_NA = TRUE)
-
+
+ if (isTRUE(italicise)) {
+ # make all microorganism names italic, according to nomenclature
+ names_col <- ifelse(isTRUE(attributes(x)$has_syndromic_group), 2, 1)
+ x[[names_col]] <- italicise_taxonomy(x[[names_col]], type = "markdown")
+ }
+
old_option <- getOption("knitr.kable.NA")
options(knitr.kable.NA = na)
on.exit(options(knitr.kable.NA = old_option))
- out <- knitr::kable(x, ..., output = FALSE)
-
- format <- attributes(out)$format
- if (isTRUE(italicise) &&
- !is.null(format) &&
- format %in% c("markdown", "pipe")) {
- # try to italicise the output
- rows_with_txt <- which(out %like% "[a-z]")
- rows_without_txt <- setdiff(seq_len(length(out)), rows_with_txt)
- out[rows_with_txt] <- gsub("^[|]", "| ", out[rows_with_txt])
- # put hyphen directly after second character
- out[rows_without_txt] <- gsub("^[|](.)", "|\\1-", out[rows_without_txt])
- out_ita <- italicise_taxonomy(as.character(out), type = "markdown")
- if (length(unique(nchar(out_ita))) != 1) {
- # so there has been alterations done by italicise_taxonomy()
- to_fill <- which(nchar(out_ita) < max(nchar(out_ita)))
- out_ita[intersect(to_fill, rows_with_txt)] <- gsub("(^[|].*?)([|])(.*)", "\\1 \\2\\3", out_ita[intersect(to_fill, rows_with_txt)], perl = TRUE)
- out_ita[intersect(to_fill, rows_without_txt)] <- gsub("(^[|].*?)([|])(.*)", "\\1--\\2\\3", out_ita[intersect(to_fill, rows_without_txt)], perl = TRUE)
- }
- attributes(out_ita) <- attributes(out)
- out <- out_ita
- }
- res <- paste(c("", "", out), collapse = "\n")
- knitr::asis_output(res)
+
+ out <- paste(c("", "", knitr::kable(x, ..., output = FALSE)), collapse = "\n")
+ knitr::asis_output(out)
}
diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R
index 099b2c23..5e9ef885 100755
--- a/R/bug_drug_combinations.R
+++ b/R/bug_drug_combinations.R
@@ -39,7 +39,7 @@
#' @param ... arguments passed on to `FUN`
#' @inheritParams sir_df
#' @inheritParams base::formatC
-#' @details The function [format()] calculates the resistance per bug-drug combination. Use `combine_SI = TRUE` (default) to test R vs. S+I and `combine_SI = FALSE` to test R+I vs. S.
+#' @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()].
#' @export
#' @rdname bug_drug_combinations
#' @return The function [bug_drug_combinations()] returns a [data.frame] with columns "mo", "ab", "S", "I", "R" and "total".
@@ -327,7 +327,15 @@ format.bug_drug_combinations <- function(x,
}
rownames(y) <- NULL
- as_original_data_class(y, class(x.bak)) # will remove tibble groups
+ as_original_data_class(y, class(x.bak), extra_class = "formatted_bug_drug_combinations") # will remove tibble groups
+}
+
+# will be exported in zzz.R
+knit_print.formatted_bug_drug_combinations <- function(x, ...) {
+ stop_ifnot_installed("knitr")
+ # make columns with MO names italic according to nomenclature
+ colnames(x)[3:NCOL(x)] <- italicise_taxonomy(colnames(x)[3:NCOL(x)], type = "markdown")
+ knitr::asis_output(paste("", "", knitr::kable(x, ...), collapse = "\n"))
}
#' @method print bug_drug_combinations
diff --git a/R/sysdata.rda b/R/sysdata.rda
index 3033c228..11333965 100755
Binary files a/R/sysdata.rda and b/R/sysdata.rda differ
diff --git a/R/zzz.R b/R/zzz.R
index ced87f1f..e8ebeb7a 100755
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -128,8 +128,9 @@ if (utf8_supported && !is_latex) {
s3_register("ggplot2::fortify", "sir")
s3_register("ggplot2::fortify", "mic")
s3_register("ggplot2::fortify", "disk")
- # Support for knitr / R Markdown
+ # Support for knitr (R Markdown/Quarto)
s3_register("knitr::knit_print", "antibiogram")
+ s3_register("knitr::knit_print", "formatted_bug_drug_combinations")
# Support vctrs package for use in e.g. dplyr verbs
# S3: ab_selector
s3_register("vctrs::vec_ptype2", "character.ab_selector")
diff --git a/data-raw/antibiograms.Rmd b/data-raw/antibiograms.Rmd
index 8be57b1c..d515f152 100644
--- a/data-raw/antibiograms.Rmd
+++ b/data-raw/antibiograms.Rmd
@@ -2,7 +2,7 @@
title: "Generating antibiograms with the AMR package"
author: "AMR package developers"
date: "`r Sys.Date()`"
-output: html_document
+output: pdf_document
---
```{r setup, include=FALSE}
diff --git a/data-raw/antibiograms.html b/data-raw/antibiograms.html
index b53df843..989da0ac 100644
--- a/data-raw/antibiograms.html
+++ b/data-raw/antibiograms.html
@@ -11,7 +11,7 @@
-
+
Generating antibiograms with the AMR package
@@ -299,23 +299,17 @@ overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
-.tabset-dropdown > .nav-tabs > li.active:before {
-content: "";
+.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
+content: "\e259";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
-content: "";
-border: none;
-}
-.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
-content: "";
+content: "\e258";
font-family: 'Glyphicons Halflings';
-display: inline-block;
-padding: 10px;
-border-right: 1px solid #ddd;
+border: none;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
@@ -359,7 +353,7 @@ display: none;
Generating antibiograms with the AMR
package
AMR package developers
-2023-02-23
+2023-02-24
@@ -370,26 +364,25 @@ package
looks like:
example_isolates
## # A tibble: 2,000 × 46
-## date patient age gender ward mo PEN
-## <date> <chr> <dbl> <chr> <chr> <mo> <sir>
-## 1 2002-01-02 A77334 65 F Clini… B_ESCHR_COLI R
-## 2 2002-01-03 A77334 65 F Clini… B_ESCHR_COLI R
-## 3 2002-01-07 067927 45 F ICU B_STPHY_EPDR R
-## 4 2002-01-07 067927 45 F ICU B_STPHY_EPDR R
-## 5 2002-01-13 067927 45 F ICU B_STPHY_EPDR R
-## 6 2002-01-13 067927 45 F ICU B_STPHY_EPDR R
-## 7 2002-01-14 462729 78 M Clini… B_STPHY_AURS R
-## 8 2002-01-14 462729 78 M Clini… B_STPHY_AURS R
-## 9 2002-01-16 067927 45 F ICU B_STPHY_EPDR R
-## 10 2002-01-17 858515 79 F ICU B_STPHY_EPDR R
-## # … with 1,990 more rows, and 39 more variables: OXA <sir>,
-## # FLC <sir>, AMX <sir>, 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>, FOS <sir>,
-## # LNZ <sir>, CIP <sir>, MFX <sir>, VAN <sir>, TEC <sir>,
-## # TCY <sir>, TGC <sir>, DOX <sir>, ERY <sir>, …
-## # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
+## date patient age gender ward mo PEN OXA FLC AMX
+## <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
+## 1 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
+## 2 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
+## 3 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
+## 4 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
+## 5 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
+## 6 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
+## 7 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
+## 8 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
+## 9 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA
+## 10 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA
+## # … with 1,990 more rows, and 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>, FOS <sir>, LNZ <sir>, CIP <sir>,
+## # MFX <sir>, VAN <sir>, TEC <sir>, TCY <sir>, TGC <sir>, DOX <sir>,
+## # ERY <sir>, CLI <sir>, AZM <sir>, IPM <sir>, MEM <sir>, MTR <sir>,
+## # CHL <sir>, COL <sir>, MUP <sir>, RIF <sir>
Traditional Antibiogram
antibiogram(example_isolates,
@@ -397,7 +390,7 @@ looks like:
-CNS (43-309) |
+CoNS (43-309) |
0 |
86 |
52 |
@@ -507,7 +500,7 @@ looks like:
-CNS (29-274) |
+CoNS (29-274) |
30 |
97 |
|
@@ -577,10 +570,20 @@ looks like:
antibiotics = c(aminoglycosides(), carbapenems()),
syndromic_group = "ward")
+
+
+
+
+
+
+
+
+
+
Clinical |
-CNS (23-205) |
+CoNS (23-205) |
|
89 |
57 |
@@ -602,7 +605,7 @@ looks like:
ICU |
-CNS (10-73) |
+CoNS (10-73) |
|
79 |
|
@@ -612,7 +615,7 @@ looks like:
Outpatient |
-CNS (3-31) |
+CoNS (3-31) |
|
84 |
|
@@ -622,7 +625,7 @@ looks like:
Clinical |
-E. coli (0-299) |
+E. coli (0-299) |
100 |
98 |
100 |
@@ -632,7 +635,7 @@ looks like:
ICU |
-E. coli (0-137) |
+E. coli (0-137) |
100 |
99 |
100 |
@@ -642,7 +645,7 @@ looks like:
Clinical |
-K. pneumoniae (0-51) |
+K. pneumoniae (0-51) |
|
92 |
100 |
@@ -652,7 +655,7 @@ looks like:
Clinical |
-P. mirabilis (0-30) |
+P. mirabilis (0-30) |
|
100 |
|
@@ -662,7 +665,7 @@ looks like:
Clinical |
-S. aureus (2-150) |
+S. aureus (2-150) |
|
99 |
|
@@ -672,7 +675,7 @@ looks like:
ICU |
-S. aureus (0-66) |
+S. aureus (0-66) |
|
100 |
|
@@ -682,7 +685,7 @@ looks like:
Clinical |
-S. epidermidis (4-79) |
+S. epidermidis (4-79) |
|
82 |
|
@@ -692,7 +695,7 @@ looks like:
ICU |
-S. epidermidis (4-75) |
+S. epidermidis (4-75) |
|
72 |
|
@@ -702,7 +705,7 @@ looks like:
Clinical |
-S. hominis (1-45) |
+S. hominis (1-45) |
|
96 |
|
@@ -712,7 +715,7 @@ looks like:
Clinical |
-S. pneumoniae (5-78) |
+S. pneumoniae (5-78) |
0 |
0 |
|
@@ -722,7 +725,7 @@ looks like:
ICU |
-S. pneumoniae (5-30) |
+S. pneumoniae (5-30) |
0 |
0 |
|
@@ -742,9 +745,9 @@ looks like:
syndromic_group = ifelse(example_isolates$age >= 65 &
example_isolates$gender == "M",
"WISCA Group 1", "WISCA Group 2"))
-
+
-
+
@@ -753,8 +756,8 @@ looks like:
WISCA Group 1 |
-Gram-negatief (261-285) |
+Gram-negative (261-285) |
76 |
95 |
89 |
@@ -772,7 +775,7 @@ looks like:
WISCA Group 2 |
-Gram-negatief (380-442) |
+Gram-negative (380-442) |
76 |
98 |
88 |
@@ -780,7 +783,7 @@ looks like:
WISCA Group 1 |
-Gram-positief (123-406) |
+Gram-positive (123-406) |
76 |
89 |
81 |
@@ -788,7 +791,7 @@ looks like:
WISCA Group 2 |
-Gram-positief (222-732) |
+Gram-positive (222-732) |
76 |
89 |
88 |
diff --git a/data-raw/antibiograms.pdf b/data-raw/antibiograms.pdf
new file mode 100644
index 00000000..cce88d05
Binary files /dev/null and b/data-raw/antibiograms.pdf differ
diff --git a/data-raw/reproduction_of_poorman.R b/data-raw/reproduction_of_poorman.R
index 11237603..96660fad 100644
--- a/data-raw/reproduction_of_poorman.R
+++ b/data-raw/reproduction_of_poorman.R
@@ -107,3 +107,4 @@ contents <- c(
writeLines(contents, "R/aa_helper_pm_functions.R")
# note: pm_left_join() will be overwritten by aaa_helper_functions.R, which contains a faster implementation
+# replace `res <- as.data.frame(res)` with `res <- as.data.frame(res, stringsAsFactors = FALSE)`
diff --git a/man/antibiogram.Rd b/man/antibiogram.Rd
index cb7798d0..55ca6e45 100644
--- a/man/antibiogram.Rd
+++ b/man/antibiogram.Rd
@@ -35,7 +35,7 @@ antibiogram(
\method{autoplot}{antibiogram}(object, ...)
-knit_print.antibiogram(
+\method{knit_print}{antibiogram}(
x,
italicise = TRUE,
na = getOption("knitr.kable.NA", default = ""),
@@ -75,7 +75,7 @@ knit_print.antibiogram(
\item{object}{an \code{\link[=antibiogram]{antibiogram()}} object}
-\item{italicise}{a \link{logical} to indicate whether the microorganism names in the \link[knitr:kable]{knitr} table should be made italic, using \code{\link[=italicise_taxonomy]{italicise_taxonomy()}}. This only works when the output format is markdown, such as in HTML output.}
+\item{italicise}{a \link{logical} to indicate whether the microorganism names in the \link[knitr:kable]{knitr} table should be made italic, using \code{\link[=italicise_taxonomy]{italicise_taxonomy()}}.}
\item{na}{character to use for showing \code{NA} values}
}
@@ -87,6 +87,9 @@ This function returns a table with values between 0 and 100 for \emph{susceptibi
\strong{Remember that you should filter your data to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them in your data set with one of the four available algorithms.
+All types of antibiograms as listed below can be plotted (using \code{\link[ggplot2:autoplot]{ggplot2::autoplot()}} or base \R \code{\link[=plot]{plot()}}/\code{\link[=barplot]{barplot()}}). The \code{antibiogram} object can also be used directly in R Markdown / Quarto (i.e., \code{knitr}) for reports. In this case, \code{\link[knitr:kable]{knitr::kable()}} will be applied automatically and microorganism names will even be printed in italics at default (see argument \code{italicise}). You can also use functions from specific 'table reporting' packages to transform the output of \code{\link[=antibiogram]{antibiogram()}} to your needs, e.g. with \code{\link[flextable:as_flextable]{as_flextable()}} or \code{\link[gt:gt]{gt()}}.
+\subsection{Antibiogram Types}{
+
There are four antibiogram types, as proposed by Klinker \emph{et al.} (2021, \doi{10.1177/20499361211011373}), and they are all supported by \code{\link[=antibiogram]{antibiogram()}}:
\enumerate{
\item \strong{Traditional Antibiogram}
@@ -134,8 +137,6 @@ your_data \%>\%
}\if{html}{\out{}}
}
-All types of antibiograms can be generated with the functions as described on this page, and can be plotted (using \code{\link[ggplot2:autoplot]{ggplot2::autoplot()}} or base \R \code{\link[=plot]{plot()}}/\code{\link[=barplot]{barplot()}}) or directly used into R Markdown / Quarto formats for reports (in the last case, \code{\link[knitr:kable]{knitr::kable()}} will be applied automatically). Use functions from specific 'table reporting' packages to transform the output of \code{\link[=antibiogram]{antibiogram()}} to your needs, e.g. \code{flextable::as_flextable()} or \code{gt::gt()}.
-
Note that for combination antibiograms, it is important to realise that susceptibility can be calculated in two ways, which can be set with the \code{only_all_tested} argument (default is \code{FALSE}). See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=antibiogram]{antibiogram()}} works to calculate the \%SI:
\if{html}{\out{}}\preformatted{--------------------------------------------------------------------
@@ -156,6 +157,7 @@ Note that for combination antibiograms, it is important to realise that suscepti
--------------------------------------------------------------------
}\if{html}{\out{
}}
}
+}
\examples{
# example_isolates is a data set available in the AMR package.
# run ?example_isolates for more info.
@@ -233,6 +235,7 @@ antibiogram(example_isolates,
)
)
+
# Print the output for R Markdown / Quarto -----------------------------
ureido <- antibiogram(example_isolates,
diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd
index be2e829f..4c12583a 100644
--- a/man/bug_drug_combinations.Rd
+++ b/man/bug_drug_combinations.Rd
@@ -55,7 +55,7 @@ The function \code{\link[=bug_drug_combinations]{bug_drug_combinations()}} retur
Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{\link[=format]{format()}} on the result to prettify it to a publishable/printable format, see \emph{Examples}.
}
\details{
-The function \code{\link[=format]{format()}} calculates the resistance per bug-drug combination. Use \code{combine_SI = TRUE} (default) to test R vs. S+I and \code{combine_SI = FALSE} to test R+I vs. S.
+The function \code{\link[=format]{format()}} calculates the resistance per bug-drug combination and returns a table ready for reporting/publishing. Use \code{combine_SI = TRUE} (default) to test R vs. S+I and \code{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. \code{\link[knitr:kable]{knitr::kable()}}.
}
\examples{
# example_isolates is a data set available in the AMR package.