1
0
mirror of https://github.com/msberends/AMR.git synced 2026-06-29 20:16:22 +02:00

(v3.0.1.9076) fix: normalise year-qualified AMR_guideline option in all affected functions

This commit is contained in:
Matthijs Berends
2026-06-27 13:53:25 +02:00
committed by GitHub
parent f7d353361c
commit 12cabca29d
7 changed files with 33 additions and 13 deletions

View File

@@ -175,6 +175,11 @@ interpretive_rules <- function(x,
...) {
meet_criteria(x, allow_class = "data.frame")
meet_criteria(col_mo, allow_class = "character", has_length = 1, is_in = colnames(x), allow_NULL = TRUE)
if (guideline %like% "EUCAST") {
guideline <- "EUCAST"
} else if (guideline %like% "CLSI") {
guideline <- "CLSI"
}
meet_criteria(guideline, allow_class = "character", has_length = 1, is_in = c("EUCAST", "CLSI"))
meet_criteria(info, allow_class = "logical", has_length = 1)
meet_criteria(rules, allow_class = "character", has_length = c(1, 2, 3, 4, 5, 6), is_in = c("breakpoints", "expected_phenotypes", "expert", "other", "all", "custom"))
@@ -200,12 +205,6 @@ interpretive_rules <- function(x,
add_MO_lookup_to_AMR_env()
if (guideline %like% "EUCAST") {
guideline <- "EUCAST"
} else if (guideline %like% "CLSI") {
guideline <- "CLSI"
}
if ("custom" %in% rules && is.null(custom_rules)) {
warning_("in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: no custom rules were set with the {.arg custom_rules} argument",
immediate = TRUE