AMR/man/bug_drug_combinations.Rd

97 lines
5.5 KiB
Plaintext
Raw Normal View History

2019-08-25 22:53:22 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bug_drug_combinations.R
\name{bug_drug_combinations}
\alias{bug_drug_combinations}
2019-08-27 22:41:09 +02:00
\alias{format.bug_drug_combinations}
2019-08-25 22:53:22 +02:00
\title{Determine bug-drug combinations}
\source{
\strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
}
\usage{
bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
2019-08-27 22:41:09 +02:00
\method{format}{bug_drug_combinations}(
x,
translate_ab = "name (ab, atc)",
language = get_locale(),
minimum = 30,
combine_SI = TRUE,
combine_IR = FALSE,
add_ab_group = TRUE,
remove_intrinsic_resistant = FALSE,
decimal.mark = getOption("OutDec"),
big.mark = ifelse(decimal.mark == ",", ".", ","),
...
)
2019-08-25 22:53:22 +02:00
}
\arguments{
\item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}}
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
2019-08-25 22:53:22 +02:00
\item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link[=mo_shortname]{mo_shortname()}}}
2019-09-23 13:53:50 +02:00
2019-09-25 15:43:22 +02:00
\item{...}{arguments passed on to \code{FUN}}
\item{translate_ab}{a character of length 1 containing column names of the \link{antibiotics} data set}
2019-09-25 15:43:22 +02:00
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
2019-09-25 15:43:22 +02:00
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
2019-09-25 15:43:22 +02:00
\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.}
2019-09-23 13:53:50 +02:00
2019-08-27 19:15:04 +02:00
\item{combine_IR}{logical to indicate whether values R and I should be summed}
2019-08-27 22:41:09 +02:00
\item{add_ab_group}{logical to indicate where the group of the antimicrobials must be included as a first column}
2019-08-27 23:00:00 +02:00
2019-09-25 15:43:22 +02:00
\item{remove_intrinsic_resistant}{logical to indicate that rows with 100\% resistance for all tested antimicrobials must be removed from the table}
2019-09-23 13:53:50 +02:00
\item{decimal.mark}{the character to be used to indicate the numeric
decimal point.}
\item{big.mark}{character; if not empty used as mark between every
\code{big.interval} decimals \emph{before} (hence \code{big}) the
decimal point.}
2019-08-25 22:53:22 +02:00
}
\value{
The function \code{\link[=bug_drug_combinations]{bug_drug_combinations()}} returns a \code{\link{data.frame}} with columns "mo", "ab", "S", "I", "R" and "total".
}
2019-08-25 22:53:22 +02:00
\description{
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 publicable/printable format, see Examples.
2019-08-25 22:53:22 +02:00
}
\details{
The function \code{\link[=format]{format()}} calculates the resistance per bug-drug combination. Use \code{combine_IR = FALSE} (default) to test R vs. S+I and \code{combine_IR = TRUE} to test R+I vs. S.
2019-09-23 13:53:50 +02:00
The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}.
}
\section{Stable lifecycle}{
\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr}
The \link[AMR:lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.
If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
}
2019-08-25 22:53:22 +02:00
\section{Read more on our website!}{
2020-02-17 14:38:01 +01:00
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
2019-08-25 22:53:22 +02:00
}
\examples{
\donttest{
x <- bug_drug_combinations(example_isolates)
2019-08-25 22:53:22 +02:00
x
2019-10-11 17:21:02 +02:00
format(x, translate_ab = "name (atc)")
2019-09-23 13:53:50 +02:00
# Use FUN to change to transformation of microorganism codes
x <- bug_drug_combinations(example_isolates,
FUN = mo_gramstain)
x <- bug_drug_combinations(example_isolates,
FUN = function(x) ifelse(x == "B_ESCHR_COLI",
"E. coli",
"Others"))
2019-08-25 22:53:22 +02:00
}
}