1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-18 00:03:24 +02:00

is.rsi.eligible update

This commit is contained in:
2019-02-04 12:24:07 +01:00
parent cd07d65734
commit 587e00b7be
25 changed files with 1115 additions and 491 deletions

View File

@ -10,10 +10,12 @@ as.rsi(x)
is.rsi(x)
is.rsi.eligible(x)
is.rsi.eligible(x, threshold = 0.05)
}
\arguments{
\item{x}{vector}
\item{threshold}{maximum fraction of \code{x} that is allowed to fail transformation, see Examples}
}
\value{
Ordered factor with new class \code{rsi}
@ -47,10 +49,15 @@ library(dplyr)
septic_patients \%>\%
mutate_at(vars(peni:rifa), as.rsi)
# fastest way to transform all columns with already valid AB results to class `rsi`:
septic_patients \%>\%
mutate_if(is.rsi.eligible,
as.rsi)
# default threshold of `is.rsi.eligible` is 5\%.
is.rsi.eligible(WHONET$`First name`) # fails, >80\% is invalid
is.rsi.eligible(WHONET$`First name`, threhold = 0.9) # succeeds
}
\seealso{
\code{\link{as.mic}}