(v0.7.1.9024) eucast_rules() fix, new MOs

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-08-06 14:39:22 +02:00
1 parent 85b62aaf8f
commit 3a1f960f89
23 files changed
+252 -411

No files matched your search

+5 -1
View File
@@ -76,7 +76,11 @@ like <- function(x, pattern) {
if (is.factor(x)) {
as.integer(x) %in% base::grep(pattern, levels(x), ignore.case = TRUE)
} else {
base::grepl(pattern, x, ignore.case = TRUE)
tryCatch(base::grepl(pattern, x, ignore.case = TRUE),
error = function(e) ifelse(test = grepl("Invalid regexp", e$message),
# try with perl = TRUE:
yes = return(base::grepl(pattern, x, ignore.case = TRUE, perl = TRUE)),
no = stop(e$message)))
}
}