mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 23:21:56 +02:00
(v1.3.0.9004) data sets, as.disk() improvement
This commit is contained in:
@ -23,6 +23,7 @@ is.rsi.eligible(x, threshold = 0.05)
|
||||
guideline = "EUCAST",
|
||||
uti = FALSE,
|
||||
conserve_capped_values = FALSE,
|
||||
add_intrinsic_resistance = FALSE,
|
||||
...
|
||||
)
|
||||
|
||||
@ -32,6 +33,7 @@ is.rsi.eligible(x, threshold = 0.05)
|
||||
ab = deparse(substitute(x)),
|
||||
guideline = "EUCAST",
|
||||
uti = FALSE,
|
||||
add_intrinsic_resistance = FALSE,
|
||||
...
|
||||
)
|
||||
|
||||
@ -41,6 +43,7 @@ is.rsi.eligible(x, threshold = 0.05)
|
||||
guideline = "EUCAST",
|
||||
uti = NULL,
|
||||
conserve_capped_values = FALSE,
|
||||
add_intrinsic_resistance = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
@ -61,6 +64,8 @@ is.rsi.eligible(x, threshold = 0.05)
|
||||
|
||||
\item{conserve_capped_values}{a logical to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"}
|
||||
|
||||
\item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a logical to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on 'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes', version 3.1, 2016.}
|
||||
|
||||
\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()}}.}
|
||||
}
|
||||
\value{
|
||||
@ -160,6 +165,9 @@ as.rsi(df)
|
||||
|
||||
# the dplyr way
|
||||
library(dplyr)
|
||||
df \%>\% mutate_if(is.mic, as.rsi)
|
||||
df \%>\% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi)
|
||||
df \%>\% mutate(across(where(is.mic), as.rsi))
|
||||
df \%>\% mutate_at(vars(AMP:TOB), as.rsi)
|
||||
df \%>\% mutate(across(AMP:TOB), as.rsi)
|
||||
|
||||
|
Reference in New Issue
Block a user