| as.disk | R Documentation |
This transforms a vector to a new class disk, which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 0 and 50.
as.disk(x, na.rm = FALSE)
NA_disk_
is.disk(x)
x |
Vector. |
na.rm |
A logical indicating whether missing values should be removed. |
An object of class disk (inherits from integer) of length 1.
Interpret disk values as SIR values with as.sir(). It supports guidelines from EUCAST and CLSI.
Disk diffusion growth zone sizes must be between 0 and 50 millimetres. Values higher than 50 but lower than 100 will be maximised to 50. All others input values outside the 0-50 range will return NA.
NA_disk_ is a missing value of the new disk class.
An integer with additional class disk
as.sir()
# transform existing disk zones to the `disk` class (using base R)
df <- data.frame(
microorganism = "Escherichia coli",
AMP = 20,
CIP = 14,
GEN = 18,
TOB = 16
)
df[, 2:5] <- lapply(df[, 2:5], as.disk)
str(df)
# transforming is easier with dplyr:
if (require("dplyr")) {
df %>% mutate(across(AMP:TOB, as.disk))
}
# interpret disk values, see ?as.sir
as.sir(
x = as.disk(18),
mo = "Strep pneu", # `mo` will be coerced with as.mo()
ab = "ampicillin", # and `ab` with as.ab()
guideline = "EUCAST"
)
# interpret whole data set, pretend to be all from urinary tract infections:
as.sir(df, uti = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.