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

(v2.1.1.9223) allow + ab

This commit is contained in:
2025-03-20 22:56:32 +01:00
parent d147d6602d
commit bb110646db
10 changed files with 43 additions and 30 deletions

10
R/ab.R
View File

@ -610,6 +610,16 @@ rep.ab <- function(x, ...) {
y
}
#' @method + ab
#' @export
#' @noRd
`+.ab` <- function(e1, e2) {
# this does not return ab class, it should just allow console usage of e.g., carbapenems() + c("", aminoglycosides())
out <- as.character(outer(e1, e2, paste, sep = " + "))
out <- gsub(" [+] $", "", out)
out
}
generalise_antibiotic_name <- function(x) {
x <- toupper(x)
# remove suffices