mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 05:00:50 +01:00
Include isolates of unknown species in grouped antibiograms and in wisca(), which were silently excluded with the warning 'invalid microorganism code, NA generated'
This commit is contained in:
1 parent
3a87075ad3
commit
eb6d07e1fe
4 files changed
+28
-7
No files matched your search
+7
-1
@@ -578,7 +578,13 @@ antibiogram.default <- function(x,
|
||||
x$`.mo` <- mo_property(x$`.mo`, property = mo_transform, language = language)
|
||||
}
|
||||
}
|
||||
x$`.mo`[x$`.mo` %in% c(NA, "UNKNOWN")] <- "(??)"
|
||||
# keep unknown microorganisms, so that they are also included in grouped antibiograms and WISCA
|
||||
if (is.mo(x$`.mo`)) {
|
||||
# the 'mo' class only allows valid codes, of which "UNKNOWN" is one
|
||||
x$`.mo`[is.na(x$`.mo`)] <- "UNKNOWN"
|
||||
} else {
|
||||
x$`.mo`[x$`.mo` %in% c(NA, "UNKNOWN")] <- "(??)"
|
||||
}
|
||||
|
||||
# get antimicrobials
|
||||
ab_trycatch <- tryCatch(colnames(suppressWarnings(x[, antimicrobials, drop = FALSE])), error = function(e) NULL)
|
||||
|
||||
Reference in new issue
Block a user