(v3.0.0.9003) eucast_rules fix, new tidymodels integration

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2025-06-13 14:03:21 +02:00
1 parent 3742e9e994
commit 72db2b2562
22 files changed
+760 -107

No files matched your search

+3 -1
View File
@@ -655,7 +655,9 @@ generalise_antibiotic_name <- function(x) {
x <- trimws(gsub(" +", " ", x, perl = TRUE))
# remove last couple of words if they numbers or units
x <- gsub("( ([0-9]{3,}|U?M?C?G|L))+$", "", x, perl = TRUE)
# move HIGH to end
# remove whitespace prior to numbers if preceded by A-Z
x <- gsub("([A-Z]+) +([0-9]+)", "\\1\\2", x, perl = TRUE)
# move HIGH to the end
x <- trimws(gsub("(.*) HIGH(.*)", "\\1\\2 HIGH", x, perl = TRUE))
x
}