1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-27 09:26:11 +01:00
AMR/man/rsi.Rd

54 lines
1.7 KiB
Plaintext
Raw Normal View History

2018-02-21 11:52:31 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rsi_analysis.R
\name{rsi}
\alias{rsi}
\title{Resistance of isolates}
\usage{
rsi(ab1, ab2 = NA, interpretation = "IR", minimum = 30, percent = FALSE,
info = FALSE, warning = FALSE)
}
\arguments{
\item{ab1, ab2}{list with interpretations of an antibiotic}
\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{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}}
}
\value{
Double or, when \code{percent = TRUE}, a character.
}
\description{
2018-02-22 20:48:48 +01:00
This function can be used in \code{dplyr}s \code{\link[dplyr]{summarise}}, see \emph{Examples}. Calculate the percentage S, SI, I, IR or R of a vector of isolates.
2018-02-21 11:52:31 +01:00
}
\details{
This function uses the \code{\link{rsi_df}} function internally.
}
\examples{
\dontrun{
2018-02-22 20:48:48 +01:00
tbl \%>\%
group_by(hospital) \%>\%
summarise(cipr = rsi(cipr))
2018-02-21 11:52:31 +01:00
tbl \%>\%
group_by(year, hospital) \%>\%
summarise(
isolates = n(),
2018-02-22 20:48:48 +01:00
cipro = rsi(cipr \%>\% as.rsi(), percent = TRUE),
amoxi = rsi(amox \%>\% as.rsi(), percent = TRUE))
rsi(as.rsi(isolates$amox))
2018-02-21 11:52:31 +01:00
2018-02-22 20:48:48 +01:00
rsi(as.rsi(isolates$amcl), interpretation = "S")
2018-02-21 11:52:31 +01:00
}
}
\keyword{antibiotics}
\keyword{isolate}
\keyword{isolates}
\keyword{rsi}