mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 00:43:00 +02:00
use dplyr where available, new antibiogram()
for WISCA, fixed Salmonella Typhi/Paratyphi
This commit is contained in:
10
R/mic.R
10
R/mic.R
@ -219,14 +219,14 @@ as.mic <- function(x, na.rm = FALSE) {
|
||||
## previously unempty values now empty - should return a warning later on
|
||||
x[x.bak != "" & x == ""] <- "invalid"
|
||||
|
||||
na_before <- x[is.na(x) | x == ""] %pm>% length()
|
||||
na_before <- x[is.na(x) | x == ""] %>% length()
|
||||
x[!x %in% valid_mic_levels] <- NA
|
||||
na_after <- x[is.na(x) | x == ""] %pm>% length()
|
||||
na_after <- x[is.na(x) | x == ""] %>% length()
|
||||
|
||||
if (na_before != na_after) {
|
||||
list_missing <- x.bak[is.na(x) & !is.na(x.bak) & x.bak != ""] %pm>%
|
||||
unique() %pm>%
|
||||
sort() %pm>%
|
||||
list_missing <- x.bak[is.na(x) & !is.na(x.bak) & x.bak != ""] %>%
|
||||
unique() %>%
|
||||
sort() %>%
|
||||
vector_and(quotes = TRUE)
|
||||
cur_col <- get_current_column()
|
||||
warning_("in `as.mic()`: ", na_after - na_before, " result",
|
||||
|
Reference in New Issue
Block a user