1
0
mirror of https://github.com/msberends/AMR.git synced 2026-04-28 12:23:54 +02:00

Add add_if_missing parameter to control NA handling in interpretive rules (#264)

This commit is contained in:
Matthijs Berends
2026-04-21 21:53:43 +02:00
committed by GitHub
parent fb8758f36b
commit 8ff5d4472a
46 changed files with 1232 additions and 1016 deletions

View File

@@ -3,13 +3,15 @@ df <- example_isolates |>
mutate(mo = ifelse(mo_genus(mo) == "Klebsiella", as.mo("Klebsiella"), mo)) |>
top_n_microorganisms(10)
out_new <- df |> antibiogram(c("TZP","TZP+GEN","TZP+TOB"), wisca = TRUE, syndromic_group = "ward")
out_nonwisca <- df |> antibiogram(c("TZP","TZP+GEN","TZP+TOB"),
syndromic_group = "ward",
mo_transform = function(x) "",
digits = 1,
minimum = 10,
formatting_type = 14) |>
out_new <- df |> antibiogram(c("TZP", "TZP+GEN", "TZP+TOB"), wisca = TRUE, syndromic_group = "ward")
out_nonwisca <- df |>
antibiogram(c("TZP", "TZP+GEN", "TZP+TOB"),
syndromic_group = "ward",
mo_transform = function(x) "",
digits = 1,
minimum = 10,
formatting_type = 14
) |>
as_tibble() |>
select(-Pathogen)
@@ -17,7 +19,3 @@ out_nonwisca <- df |> antibiogram(c("TZP","TZP+GEN","TZP+TOB"),
# parameters_amr.R: number of first isolates are determined on the whole data set, while Klebsiella is aggregated afterwards (=duplicates on genus level)
source("~/Downloads/estimate_definition_amr.R")