1
0
mirror of https://github.com/msberends/AMR.git synced 2025-08-05 05:35:13 +02:00
Files
.github
R
data
data-raw
inst
man
AMR-deprecated.Rd
AMR-options.Rd
AMR.Rd
WHOCC.Rd
WHONET.Rd
ab_from_text.Rd
ab_property.Rd
add_custom_antimicrobials.Rd
add_custom_microorganisms.Rd
age.Rd
age_groups.Rd
antibiogram.Rd
antimicrobial_selectors.Rd
antimicrobials.Rd
as.ab.Rd
as.av.Rd
as.disk.Rd
as.mic.Rd
as.mo.Rd
as.sir.Rd
atc_online.Rd
av_from_text.Rd
av_property.Rd
availability.Rd
bug_drug_combinations.Rd
clinical_breakpoints.Rd
count.Rd
custom_eucast_rules.Rd
custom_mdro_guideline.Rd
dosage.Rd
eucast_rules.Rd
example_isolates.Rd
example_isolates_unclean.Rd
export_ncbi_biosample.Rd
first_isolate.Rd
g.test.Rd
get_episode.Rd
ggplot_pca.Rd
ggplot_sir.Rd
guess_ab_col.Rd
intrinsic_resistant.Rd
italicise_taxonomy.Rd
join.Rd
key_antimicrobials.Rd
kurtosis.Rd
like.Rd
mdro.Rd
mean_amr_distance.Rd
microorganisms.Rd
microorganisms.codes.Rd
microorganisms.groups.Rd
mo_matching_score.Rd
mo_property.Rd
mo_source.Rd
pca.Rd
plot.Rd
proportion.Rd
random.Rd
resistance_predict.Rd
skewness.Rd
top_n_microorganisms.Rd
translate.Rd
pkgdown
tests
vignettes
.Rbuildignore
.gitignore
AMR.Rproj
CRAN-SUBMISSION
DESCRIPTION
LICENSE
NAMESPACE
NEWS.md
README.Rmd
README.md
_pkgdown.yml
codecov.yml
cran-comments.md
index.Rmd
index.md
logo.svg
AMR/man/random.Rd

54 lines
2.3 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/random.R
\name{random}
\alias{random}
\alias{random_mic}
\alias{random_disk}
\alias{random_sir}
\title{Random MIC Values/Disk Zones/SIR Generation}
\usage{
random_mic(size = NULL, mo = NULL, ab = NULL, ...)
random_disk(size = NULL, mo = NULL, ab = NULL, ...)
random_sir(size = NULL, prob_SIR = c(0.33, 0.33, 0.33), ...)
}
\arguments{
\item{size}{Desired size of the returned vector. If used in a \link{data.frame} call or \code{dplyr} verb, will get the current (group) size if left blank.}
\item{mo}{Any \link{character} that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}.}
\item{ab}{Any \link{character} that can be coerced to a valid antimicrobial drug code with \code{\link[=as.ab]{as.ab()}}.}
\item{...}{Ignored, only in place to allow future extensions.}
\item{prob_SIR}{A vector of length 3: the probabilities for "S" (1st value), "I" (2nd value) and "R" (3rd value).}
}
\value{
class \code{mic} for \code{\link[=random_mic]{random_mic()}} (see \code{\link[=as.mic]{as.mic()}}) and class \code{disk} for \code{\link[=random_disk]{random_disk()}} (see \code{\link[=as.disk]{as.disk()}})
}
\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 drug, the generated results will reflect reality as much as possible.
}
\details{
The base \R function \code{\link[=sample]{sample()}} is used for generating values.
Generated values are based on the EUCAST 2025 guideline as implemented in the \link{clinical_breakpoints} data set. To create specific generated values per bug or drug, set the \code{mo} and/or \code{ab} argument.
}
\examples{
random_mic(25)
random_disk(25)
random_sir(25)
\donttest{
# make the random generation more realistic by setting a bug and/or drug:
random_mic(25, "Klebsiella pneumoniae") # range 0.0625-64
random_mic(25, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
random_mic(25, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
random_disk(25, "Klebsiella pneumoniae") # range 8-50
random_disk(25, "Klebsiella pneumoniae", "ampicillin") # range 11-17
random_disk(25, "Streptococcus pneumoniae", "ampicillin") # range 12-27
}
}