1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-13 00:32:34 +02:00

new SDD and N for as.sir()

This commit is contained in:
2024-05-20 15:27:04 +02:00
parent b68f47d985
commit 08a27922a8
28 changed files with 225 additions and 172 deletions

View File

@ -282,6 +282,8 @@ generate_antimcrobials_string <- function(df) {
as.list(df),
function(x) {
x <- toupper(as.character(x))
x[x == "SDD"] <- "I"
# ignore "N" here, no use for determining first isolates
x[!x %in% c("S", "I", "R")] <- "."
paste(x)
}
@ -312,7 +314,7 @@ antimicrobials_equal <- function(y,
val <- strsplit(val, "", fixed = TRUE)[[1L]]
val.int <- rep(NA_real_, length(val))
val.int[val == "S"] <- 1
val.int[val == "I"] <- 2
val.int[val %in% c("I", "SDD")] <- 2
val.int[val == "R"] <- 3
val.int
}