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

WHO update, antibiotics update

This commit is contained in:
2019-01-25 13:18:41 +01:00
parent 3ec44b6e0c
commit f4ff98b470
99 changed files with 1363 additions and 737 deletions

6
R/mo.R
View File

@ -707,7 +707,11 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
if (n_distinct(failures) > 1) {
plural <- "s"
}
msg <- paste0("\n", n_distinct(failures), " unique value", plural, " could not be coerced to a valid MO code")
total_failures <- length(x_input[x_input %in% failures & !x_input %in% c(NA, NULL, NaN)])
total_n <- length(x_input[!x_input %in% c(NA, NULL, NaN)])
msg <- paste0("\n", n_distinct(failures), " unique value", plural,
" (^= ", percent(total_failures / total_n, round = 1, force_zero = TRUE),
") could not be coerced to a valid MO code")
if (n_distinct(failures) <= 10) {
msg <- paste0(msg, ": ", paste('"', unique(failures), '"', sep = "", collapse = ', '))
}