1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 20:21:52 +02:00

(v2.1.1.9221) allow combined numeric MIC values

This commit is contained in:
2025-03-20 21:47:45 +01:00
parent 79f56ad8a4
commit 43660f2b18
5 changed files with 10 additions and 7 deletions

View File

@ -201,6 +201,10 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all") {
# transform Unicode for >= and <=
x <- gsub("\u2264", "<=", x, fixed = TRUE)
x <- gsub("\u2265", ">=", x, fixed = TRUE)
if (any(x %like% "[0-9]/.*[0-9]", na.rm = TRUE)) {
warning_("Some MICs were combined values, only the first values are kept")
x[x %like% "[0-9]/.*[0-9]"] <- gsub("/.*", "", x[x %like% "[0-9]/.*[0-9]"])
}
# remove other invalid characters
x <- gsub("[^a-zA-Z0-9.><= -]+", "", x, perl = TRUE)
# transform => to >= and =< to <=