(v0.8.0.9011) col guess update

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-11-04 12:08:08 +01:00
1 parent 9060233953
commit fe606e287b
10 files changed
+20 -14

No files matched your search

+8 -2
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") {