% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rsi_analysis.R \name{rsi} \alias{rsi} \alias{rsi_df} \alias{n_rsi} \title{Resistance of isolates} \usage{ rsi(ab1, ab2 = NA, interpretation = "IR", minimum = 30, as_percent = FALSE, info = FALSE, warning = TRUE) rsi_df(tbl, ab, interpretation = "IR", minimum = 30, as_percent = FALSE, info = TRUE, warning = TRUE) n_rsi(ab1, ab2 = NA) } \arguments{ \item{ab1, ab2}{vector of antibiotic interpretations, they will be transformed internally with \code{\link{as.rsi}}} \item{interpretation}{antimicrobial interpretation of which the portion must be calculated. Valid values are \code{"S"}, \code{"SI"}, \code{"I"}, \code{"IR"} or \code{"R"}.} \item{minimum}{minimal amount of available isolates. Any number lower than \code{minimum} will return \code{NA} with a warning (when \code{warning = TRUE}).} \item{as_percent}{return output as percent (text), will else (at default) be a double} \item{info}{calculate the amount of available isolates and print it, like \code{n = 423}} \item{warning}{show a warning when the available amount of isolates is below \code{minimum}} \item{tbl}{\code{data.frame} containing columns with antibiotic interpretations.} \item{ab}{character vector with 1, 2 or 3 antibiotics that occur as column names in \code{tbl}, like \code{ab = c("amox", "amcl")}} } \value{ Double or, when \code{as_percent = TRUE}, a character. } \description{ This functions can be used to calculate the (co-)resistance of isolates (i.e. percentage S, SI, I, IR or R [of a vector] of isolates). The functions \code{rsi} and \code{n_rsi} can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}. } \details{ Remember that you should filter your table to let it contain \strong{only first isolates}! \if{html}{ \cr \cr To calculate the probability (\emph{p}) of susceptibility of one antibiotic, we use this formula: \out{