mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 07:50:50 +01:00
(v3.0.1.9132) Make translating around 50 times faster and coercion of unknown input in as.ab() up to 70 times faster with identical results, use DOIs instead of PubMed URLs, shorten an example line, and reword cran-comments.md
This commit is contained in:
1 parent
4115db67fa
commit
1a1a3abed1
12 files changed
+164
-112
No files matched your search
+5
-3
@@ -180,9 +180,11 @@ ab_group <- function(x, language = get_AMR_locale(), all_groups = FALSE, ...) {
|
||||
# take the first match based on ABX_PRIORITY_LIST
|
||||
grps[[i]] <- grps[[i]][1]
|
||||
}
|
||||
if (language != "en") {
|
||||
grps[[i]] <- translate_into_language(grps[[i]], language = language, only_affect_ab_names = TRUE)
|
||||
}
|
||||
}
|
||||
if (language != "en" && length(grps) > 0) {
|
||||
# translate all groups at once
|
||||
grps_translated <- translate_into_language(unlist(grps, use.names = FALSE), language = language, only_affect_ab_names = TRUE)
|
||||
grps[] <- split(grps_translated, factor(rep(seq_along(grps), lengths(grps)), levels = seq_along(grps)))
|
||||
}
|
||||
names(grps) <- x
|
||||
if (length(grps) == 1 || all_groups == FALSE) {
|
||||
|
||||
Reference in new issue
Block a user