1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-07 17:31:34 +01:00

(v3.0.1.9027) Fixes #252 and add documentation update regarding #253

This commit is contained in:
2026-03-06 13:10:33 +01:00
parent 60e8f2bae6
commit c0a394008e
7 changed files with 20 additions and 11 deletions

View File

@@ -568,6 +568,7 @@ as.sir.default <- function(x,
x[x %like% "dose"] <- "SDD"
mtch <- grepl(paste0("(", S, "|", I, "|", R, "|", NI, "|", SDD, "|", WT, "|", NWT, "|", NS, "|[A-Z]+)"), x, perl = TRUE)
x[!mtch] <- ""
x[mtch] <- trimws2(gsub("[^\\p{L}]", "", x[mtch], perl = TRUE)) # \p{L} is the Unicode category for all letters, including those with diacritics
# apply regexes set by user
x[x %like% S] <- "S"
x[x %like% I] <- "I"