AMR/man/n_rsi.Rd

31 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-08-10 15:01:05 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/n_rsi.R
\name{n_rsi}
\alias{n_rsi}
\title{Count cases with antimicrobial results}
\usage{
2018-08-23 00:40:36 +02:00
n_rsi(...)
2018-08-10 15:01:05 +02:00
}
\arguments{
2018-08-23 00:40:36 +02:00
\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.}
2018-08-10 15:01:05 +02:00
}
\description{
2018-08-23 00:40:36 +02:00
This counts all cases where antimicrobial interpretations are available. The way it can be used is equal to \code{\link{n_distinct}}. Its function is equal to \code{count_S(...) + count_IR(...)}.
2018-08-10 15:01:05 +02:00
}
\examples{
library(dplyr)
septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(cipro_p = portion_S(cipr, as_percent = TRUE),
cipro_n = n_rsi(cipr),
genta_p = portion_S(gent, as_percent = TRUE),
genta_n = n_rsi(gent),
combination_p = portion_S(cipr, gent, as_percent = TRUE),
combination_n = n_rsi(cipr, gent))
}
\seealso{
2018-08-23 00:40:36 +02:00
\code{\link[AMR]{count}_*} to count resistant and susceptibile isolates per interpretation type.\cr
\code{\link{portion}_*} to calculate microbial resistance and susceptibility.
2018-08-10 15:01:05 +02:00
}