1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 18:22:02 +02:00

adding mo fixes

This commit is contained in:
2023-01-14 19:50:25 +01:00
parent ca79068604
commit b94bc6c67b
12 changed files with 69 additions and 44 deletions

3
R/mo.R
View File

@ -236,9 +236,8 @@ as.mo <- function(x,
x[trimws2(x) %like% translate_into_language("no .*growth", language = language)] <- NA_character_
x[trimws2(x) %like% paste0("^(", translate_into_language("no|not", language = language), ") ")] <- NA_character_
# groups are in our taxonomic table with a capital G, and complexes might be added by the user
# groups are in our taxonomic table with a capital G
x <- gsub(" group( |$)", " Group\\1", x, perl = TRUE)
x <- gsub(" complex( |$)", " Complex\\1", x, perl = TRUE)
# run over all unique leftovers
x_unique <- unique(x[is.na(out) & !is.na(x)])