force_mic | R Documentation |
Convert a value that is "almost" an MIC into a valid MIC value.
force_mic(
value,
levels_from_AMR = FALSE,
max_conc = 512,
min_conc = 0.002,
method = "closest",
prefer = "max"
)
value |
vector of MIC-like values (numeric or character) |
levels_from_AMR |
conform to AMR::as.mic levels |
max_conc |
maximum concentration to force to |
min_conc |
minimum concentration to force to |
method |
method to use when forcing MICs (closest or round_up) |
prefer |
where value is in between MIC (e.g., 24mg/L) chose the higher MIC ("max") or lower MIC ("min"); only applies to method = "closest" |
Some experimental or analytical conditions measure MIC (or surrogate) in a way that does not fully conform to traditional MIC levels (i.e., concentrations). This function allows these values to be coerced into an MIC value that is compatible with the AMR::mic class. When using method = "closest", the function will choose the closest MIC value to the input value (e.g., 2.45 will be coerced to 2). When using method = "round up", the function will round up to the next highest MIC value (e.g., 2.45 will be coerced to 4). "Round up" is technically the correct approach if the input value was generated from an experiment that censored between concentrations (e.g., broth or agar dilution). However, "closest" may be more appropriate in some cases.
AMR::as.mic compatible character
force_mic(c("2.32", "<4.12", ">1.01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.