1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:11:54 +02:00

support for old rsi arguments

This commit is contained in:
2023-03-11 14:24:34 +01:00
parent 4416394e10
commit 262598b8d7
21 changed files with 327 additions and 199 deletions

View File

@ -127,8 +127,8 @@ Case example: Susceptibility of \emph{Pseudomonas aeruginosa} to TZP among respi
Code example:
\if{html}{\out{<div class="sourceCode r">}}\preformatted{library(dplyr)
your_data \%>\%
filter(ward == "ICU" & specimen_type == "Respiratory") \%>\%
your_data \%>\%
filter(ward == "ICU" & specimen_type == "Respiratory") \%>\%
antibiogram(antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = ifelse(.$age >= 65 &
.$gender == "Male" &
@ -214,11 +214,12 @@ ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ]
# with a custom language, though this will be determined automatically
# (i.e., this table will be in Spanish on Spanish systems)
antibiogram(ex1,
antibiotics = aminoglycosides(),
ab_transform = "name",
syndromic_group = ifelse(ex1$ward == "ICU",
"UCI", "No UCI"),
language = "es"
antibiotics = aminoglycosides(),
ab_transform = "name",
syndromic_group = ifelse(ex1$ward == "ICU",
"UCI", "No UCI"
),
language = "es"
)
@ -226,21 +227,22 @@ antibiogram(ex1,
# the data set could contain a filter for e.g. respiratory specimens/ICU
antibiogram(example_isolates,
antibiotics = c("AMC", "AMC+CIP", "TZP", "TZP+TOB"),
mo_transform = "gramstain",
minimum = 10, # this should be >=30, but now just as example
syndromic_group = ifelse(example_isolates$age >= 65 &
example_isolates$gender == "M",
"WISCA Group 1", "WISCA Group 2"
)
antibiotics = c("AMC", "AMC+CIP", "TZP", "TZP+TOB"),
mo_transform = "gramstain",
minimum = 10, # this should be >=30, but now just as example
syndromic_group = ifelse(example_isolates$age >= 65 &
example_isolates$gender == "M",
"WISCA Group 1", "WISCA Group 2"
)
)
# Print the output for R Markdown / Quarto -----------------------------
ureido <- antibiogram(example_isolates,
antibiotics = ureidopenicillins(),
ab_transform = "name")
antibiotics = ureidopenicillins(),
ab_transform = "name"
)
# in an Rmd file, you would just need to return `ureido` in a chunk,
# but to be explicit here:
@ -270,6 +272,5 @@ if (requireNamespace("ggplot2")) {
plot(ab1)
plot(ab2)
}
}

View File

@ -19,8 +19,8 @@
ab = NULL,
guideline = "EUCAST",
main = deparse(substitute(x)),
ylab = "Frequency",
xlab = "Minimum Inhibitory Concentration (mg/L)",
ylab = translate_AMR("Frequency", language = language),
xlab = translate_AMR("Minimum Inhibitory Concentration (mg/L)", language = language),
colours_SIR = c("#3CAEA3", "#F6D55C", "#ED553B"),
language = get_AMR_locale(),
expand = TRUE,
@ -33,8 +33,8 @@
ab = NULL,
guideline = "EUCAST",
title = deparse(substitute(object)),
ylab = "Frequency",
xlab = "Minimum Inhibitory Concentration (mg/L)",
ylab = translate_AMR("Frequency", language = language),
xlab = translate_AMR("Minimum Inhibitory Concentration (mg/L)", language = language),
colours_SIR = c("#3CAEA3", "#F6D55C", "#ED553B"),
language = get_AMR_locale(),
expand = TRUE,
@ -46,8 +46,8 @@
\method{plot}{disk}(
x,
main = deparse(substitute(x)),
ylab = "Frequency",
xlab = "Disk diffusion diameter (mm)",
ylab = translate_AMR("Frequency", language = language),
xlab = translate_AMR("Disk diffusion diameter (mm)", language = language),
mo = NULL,
ab = NULL,
guideline = "EUCAST",
@ -62,8 +62,8 @@
mo = NULL,
ab = NULL,
title = deparse(substitute(object)),
ylab = "Frequency",
xlab = "Disk diffusion diameter (mm)",
ylab = translate_AMR("Frequency", language = language),
xlab = translate_AMR("Disk diffusion diameter (mm)", language = language),
guideline = "EUCAST",
colours_SIR = c("#3CAEA3", "#F6D55C", "#ED553B"),
language = get_AMR_locale(),
@ -75,8 +75,8 @@
\method{plot}{sir}(
x,
ylab = "Percentage",
xlab = "Antimicrobial Interpretation",
ylab = translate_AMR("Percentage", language = language),
xlab = translate_AMR("Antimicrobial Interpretation", language = language),
main = deparse(substitute(x)),
language = get_AMR_locale(),
...
@ -85,8 +85,8 @@
\method{autoplot}{sir}(
object,
title = deparse(substitute(object)),
xlab = "Antimicrobial Interpretation",
ylab = "Frequency",
xlab = translate_AMR("Antimicrobial Interpretation", language = language),
ylab = translate_AMR("Frequency", language = language),
colours_SIR = c("#3CAEA3", "#F6D55C", "#ED553B"),
language = get_AMR_locale(),
...