(v2.1.1.9223) allow + ab

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2025-03-20 22:56:32 +01:00
1 parent d147d6602d
commit bb110646db
10 files changed
+43 -30

No files matched your search

+10
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