1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 05:41:59 +02:00

(v2.1.1.9049) new 2024 breakpoints, add AMO, set NI instead of N

This commit is contained in:
2024-06-14 22:39:01 +02:00
parent de17de1be9
commit 9bf7584d58
57 changed files with 4375 additions and 135 deletions

4
R/mo.R
View File

@ -285,7 +285,9 @@ as.mo <- function(x,
# do a pre-match on first character (and if it contains a space, first chars of first two terms)
if (length(x_parts) %in% c(2, 3)) {
# for genus + species + subspecies
if (nchar(gsub("[^a-z]", "", x_parts[1], perl = TRUE)) <= 3) {
if (paste(x_parts[1:2], collapse = " ") %in% AMR_env$MO_lookup$fullname_lower) {
filtr <- which(AMR_env$MO_lookup$fullname_lower %like% paste(x_parts[1:2], collapse = " "))
} else if (nchar(gsub("[^a-z]", "", x_parts[1], perl = TRUE)) <= 3) {
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_parts[1], 1, 1) &
(AMR_env$MO_lookup$species_first == substr(x_parts[2], 1, 1) |
AMR_env$MO_lookup$subspecies_first == substr(x_parts[2], 1, 1) |