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

34 lines
757 B
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/classes.R
\name{as.rsi}
\alias{as.rsi}
\alias{is.rsi}
\title{Class 'rsi'}
\usage{
as.rsi(x)
is.rsi(x)
}
\arguments{
\item{x}{vector}
}
\value{
New class \code{rsi}
}
\description{
This transforms a vector to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning.
}
\examples{
rsi_data <- as.rsi(c(rep("S", 474), rep("I", 36), rep("R", 370)))
rsi_data <- as.rsi(c(rep("S", 474), rep("I", 36), rep("R", 370), "A", "B", "C"))
2018-02-22 20:48:48 +01:00
is.rsi(rsi_data)
plot(rsi_data)
\donttest{
library(dplyr)
tbl \%>\%
mutate_at(vars(ends_with("_rsi")), as.rsi)
sapply(mic_data, is.rsi)
}
2018-02-21 11:52:31 +01:00
}