revert back to pre-antibiogram

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2023-02-09 13:07:39 +01:00
1 parent aa48c6bf53
commit 1a0dc4bf46
53 files changed
+984 -1996

No files matched your search

+8 -3
View File
@@ -159,9 +159,14 @@ join_microorganisms <- function(type, x, by, suffix, ...) {
by <- stats::setNames("mo", by)
}
# this will use dplyr if available, and the slower poorman otherwise, see R/aaa_helper_pm_functions.R
join_fn <- get(type, envir = asNamespace("AMR"))
# use dplyr if available - it's much faster than poorman alternatives
dplyr_join <- import_fn(name = type, pkg = "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_join)) {
join_fn <- dplyr_join
} else {
# otherwise use poorman, see R/aa_helper_pm_functions.R
join_fn <- get(paste0("pm_", type), envir = asNamespace("AMR"))
}
MO_df <- AMR_env$MO_lookup[, colnames(AMR::microorganisms), drop = FALSE]
if (type %like% "full|left|right|inner") {
joined <- join_fn(x = x, y = MO_df, by = by, suffix = suffix, ...)