mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 13:21:50 +02:00
(v1.3.0.9015) as.mo() speedup for valid taxonomic names
This commit is contained in:
7
R/mo.R
7
R/mo.R
@ -178,6 +178,13 @@ as.mo <- function(x,
|
||||
...) {
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
if (tryCatch(all(tolower(x) %in% MO_lookup$fullname_lower, na.rm = TRUE)
|
||||
& isFALSE(Becker)
|
||||
& isFALSE(Lancefield), error = function(e) FALSE)) {
|
||||
# to improve speed, special case for taxonomically correct full names (case-insensitive)
|
||||
return(MO_lookup[match(tolower(x), MO_lookup$fullname_lower), "mo", drop = TRUE])
|
||||
}
|
||||
|
||||
# start off with replaced language-specific non-ASCII characters with ASCII characters
|
||||
x <- parse_and_convert(x)
|
||||
|
Reference in New Issue
Block a user