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.

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()

...

extension for future versions, not used at the moment

prob_RSI

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

Value

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

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.

Maturing Lifecycle


The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

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. As we would like to better understand the backgrounds and needs of our users, please participate in our survey!

Examples

random_mic(100)
random_disk(100)
random_rsi(100)

# \donttest{
# 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 11-50
random_disk(100, "Klebsiella pneumoniae", "ampicillin")    # range 6-14
random_disk(100, "Streptococcus pneumoniae", "ampicillin") # range 16-22
# }