1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 19:01:51 +02:00

(v2.1.1.9056) example fix

This commit is contained in:
2024-06-17 14:52:18 +02:00
parent 1e65b5a289
commit d9e66fb118
5 changed files with 21 additions and 18 deletions

View File

@ -296,13 +296,13 @@ if (require("dplyr")) {
ab = "antibiotic",
guideline = "CLSI")))
df_long \%>\%
# given certain columns, e.g. from AMP to TOB
mutate_at(vars(AMP:TOB), as.sir,
# given certain columns, e.g. from 'cipro' to 'genta'
mutate_at(vars(cipro:genta), as.sir,
mo = "bacteria",
ab = "antibiotic",
guideline = "CLSI")
df_long \%>\%
mutate(across(AMP:TOB,
mutate(across(cipro:genta,
function(x) as.sir(x,
mo = "bacteria",
ab = "antibiotic",
@ -326,13 +326,13 @@ if (require("dplyr")) {
guideline = "CLSI")))
df_long \%>\%
# given certain columns, e.g. from AMP to TOB
mutate_at(vars(AMP:TOB), as.sir,
mutate_at(vars(cipro:genta), as.sir,
mo = "bacteria",
ab = "antibiotic",
host = "animal_species",
guideline = "CLSI")
df_long \%>\%
mutate(across(AMP:TOB,
mutate(across(cipro:genta,
function(x) as.sir(x,
mo = "bacteria",
ab = "antibiotic",
@ -351,7 +351,7 @@ if (require("dplyr")) {
as.sir() # automatically determines urine isolates
df_wide \%>\%
mutate_at(vars(AMP:TOB), as.sir, mo = "E. coli", uti = TRUE)
mutate_at(vars(cipro:genta), as.sir, mo = "E. coli", uti = TRUE)
}