random: Random MIC Values/Disk Zones/RSI Generation

Description Usage Arguments Details Value Stable Lifecycle Read more on Our Website! Examples

Description

These functions can be used for generating random MIC values and disk diffusion diameters, for AMR data analysis practice. By providing a microorganism and antimicrobial agent, the generated results will reflect reality as much as possible.

Usage

1
2
3
4
5
random_mic(size, mo = NULL, ab = NULL, ...)

random_disk(size, mo = NULL, ab = NULL, ...)

random_rsi(size, prob_RSI = c(0.33, 0.33, 0.33), ...)

Arguments

size

desired size of the returned vector

mo

any character that can be coerced to a valid microorganism code with as.mo()

ab

any character that can be coerced to a valid antimicrobial agent code with as.ab()

...

ignored, only in place to allow future extensions

prob_RSI

a vector of length 3: the probabilities for R (1st value), S (2nd value) and I (3rd value)

Details

The base R function sample() is used for generating values.

Generated values are based on the latest EUCAST guideline implemented in the rsi_translation data set. To create specific generated values per bug or drug, set the mo and/or ab argument.

Value

class <mic> for random_mic() (see as.mic()) and class <disk> for random_disk() (see as.disk())

Stable Lifecycle


The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

Read more on Our Website!

On our website https://msberends.github.io/AMR/ you can find a comprehensive tutorial about how to conduct AMR data analysis, the complete documentation of all functions and an example analysis using WHONET data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
random_mic(100)
random_disk(100)
random_rsi(100)


# make the random generation more realistic by setting a bug and/or drug:
random_mic(100, "Klebsiella pneumoniae")                 # range 0.0625-64
random_mic(100, "Klebsiella pneumoniae", "meropenem")    # range 0.0625-16
random_mic(100, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4

random_disk(100, "Klebsiella pneumoniae")                  # range 8-50
random_disk(100, "Klebsiella pneumoniae", "ampicillin")    # range 11-17
random_disk(100, "Streptococcus pneumoniae", "ampicillin") # range 12-27

AMR documentation built on June 3, 2021, 5:09 p.m.