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

added prevalence column and alterted as.mo algorith to use it, added ab_name as alias

This commit is contained in:
2018-09-16 16:43:29 +02:00
parent b0ca49d68d
commit b792a2754e
16 changed files with 101 additions and 79 deletions

View File

@ -207,7 +207,7 @@ mo_property <- function(x, property = 'fullname', Becker = FALSE, Lancefield = F
#' @importFrom dplyr %>% case_when
mo_translate <- function(x, language) {
if (is.null(language)) {
language <- mo_getlangcode()
language <- Sys.locale()
} else {
language <- tolower(language[1])
}
@ -350,17 +350,3 @@ mo_translate <- function(x, language) {
)
}
#' @importFrom dplyr case_when
mo_getlangcode <- function() {
sys <- base::Sys.getlocale()
case_when(
sys %like% '(Deutsch|German|de_)' ~ "de",
sys %like% '(Nederlands|Dutch|nl_)' ~ "nl",
sys %like% '(Espa.ol|Spanish|es_)' ~ "es",
sys %like% '(Fran.ais|French|fr_)' ~ "fr",
sys %like% '(Portugu.s|Portuguese|pt_)' ~ "pt",
sys %like% '(Italiano|Italian|it_)' ~ "it",
TRUE ~ "en"
)
}