1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 16:02:02 +02:00

(v1.1.0.9017) as.ab() update, added ab_url()

This commit is contained in:
2020-05-22 20:15:19 +02:00
parent 1b1e243d14
commit e467cc103e
90 changed files with 269 additions and 2694 deletions

2
R/ab.R
View File

@ -216,7 +216,7 @@ as.ab <- function(x, ...) {
# replace multiple same characters to single one with '+', like "ll" -> "l+"
x_spelling <- gsub("(.)\\1+", "\\1+", x_spelling)
# replace spaces and slashes with a possibility on both
x_spelling <- gsub("[ /]", "( |/)", x_spelling)
x_spelling <- gsub("[ /]", "( .*|.*/)", x_spelling)
# try if name starts with it
found <- antibiotics[which(antibiotics$name %like% paste0("^", x_spelling)), ]$ab