1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 20:02:04 +02:00

bring back antibiogram(), without deps

This commit is contained in:
2023-02-10 16:18:00 +01:00
parent 70a7ba0206
commit bc434db835
42 changed files with 11307 additions and 4734 deletions

View File

@ -900,12 +900,16 @@ mo_validate <- function(x, property, language, keep_synonyms = keep_synonyms, ..
}
# get property reeaaally fast using match()
x <- AMR_env$MO_lookup[[property]][match(x, AMR_env$MO_lookup$mo)]
if (property == "snomed") {
x <- lapply(x, function(y) unlist(AMR_env$MO_lookup$snomed[match(y, AMR_env$MO_lookup$mo)]))
} else {
x <- AMR_env$MO_lookup[[property]][match(x, AMR_env$MO_lookup$mo)]
}
if (property == "mo") {
return(set_clean_class(x, new_class = c("mo", "character")))
} else if (property == "snomed") {
return(sort(as.character(eval(parse(text = x)))))
return(x)
} else if (property == "prevalence") {
return(as.double(x))
} else {