1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-11 03:42:01 +02:00

(v0.8.0.9011) col guess update

This commit is contained in:
2019-11-04 12:08:08 +01:00
parent 9060233953
commit fe606e287b
10 changed files with 20 additions and 14 deletions

View File

@ -36,11 +36,17 @@ search_type_in_df <- function(x, type) {
found <- NULL
colnames(x) <- trimws(colnames(x))
# -- mo
if (type == "mo") {
if ("mo" %in% lapply(x, class)) {
found <- colnames(x)[lapply(x, class) == "mo"][1]
} else if ("mo" %in% colnames(x) &
suppressWarnings(
all(x$mo %in% c(NA,
microorganisms$mo,
microorganisms.translation$mo_old)))) {
found <- "mo"
} else if (any(colnames(x) %like% "^(mo|microorganism|organism|bacteria|bacterie)s?$")) {
found <- colnames(x)[colnames(x) %like% "^(mo|microorganism|organism|bacteria|bacterie)s?$"][1]
} else if (any(colnames(x) %like% "^(microorganism|organism|bacteria|bacterie)")) {
@ -48,7 +54,7 @@ search_type_in_df <- function(x, type) {
} else if (any(colnames(x) %like% "species")) {
found <- colnames(x)[colnames(x) %like% "species"][1]
}
}
# -- key antibiotics
if (type == "keyantibiotics") {