(v3.0.1.9151) Fix inconsistencies in the plotting functions and correct the translations of the interpretation categories

Plotting:
- Base colours and legends of interpreted MIC and disk values on the interpretation itself instead of matching colours
- Fix SDD in autoplot() for disks, the colours of barplot() for SIR values, and barplot() for MICs ignoring language and expand
- Match a named colours_SIR by name; let keep_operators = TRUE/FALSE in scale_*_mic() behave as "all"/"none"
- Let a named values in scale_*_sir() replace the colours it names, warn in scale_x_sir(), and pass other arguments on
- Let the default of eucast_I follow the guideline option, also for EUCAST before 2019
- Support unquoted column names in facet_sir() without evaluating them
- Correct the documentation and examples

Translations:
- Add SDD, NS, WT and NWT, and correct S, I, R and NI in 18 languages
- Sources of the terms for 'I': NAK via German laboratories (de), SZU national reference laboratory (cs), lex.dk (da), Karolinska University Hospital (sv), COESANT (es), Nordlab (fi), CA-SFM (fr); no by analogy with da and sv
- Not verified against an official source: ar, bn, el, hi, id, ja, ko, pl, ro, ru, sw, tr, uk, ur, vi, zh

Tests:
- Let the grouped antibiogram test use English so it passes in other locales
This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-10-15 22:25:20 +02:00
1 parent b63263cc56
commit 43accd35d1
9 files changed
+333 -359

No files matched your search

+4 -1
View File
@@ -49,7 +49,10 @@ test_that("test-antibiogram.R", {
expect_false(identical(as.data.frame(wisca_all), as.data.frame(wisca_known)))
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) {
ab_grouped <- tryCatch(
example_isolates %>% group_by(ward) %>% antibiogram(antimicrobials = "GEN", minimum = 0, formatting_type = 1, guideline = "EUCAST"),
# pathogen names are translated, so test in English, which must also hold on systems in another language
example_isolates %>%
group_by(ward) %>%
antibiogram(antimicrobials = "GEN", minimum = 0, formatting_type = 1, guideline = "EUCAST", language = "en"),
warning = function(w) conditionMessage(w)
)
expect_inherits(ab_grouped, "antibiogram")