mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 08:52:15 +02:00
(v1.7.1.9067) Support for Swedish and Russian
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
\alias{set_ab_names}
|
||||
\title{Get Properties of an Antibiotic}
|
||||
\usage{
|
||||
ab_name(x, language = get_locale(), tolower = FALSE, ...)
|
||||
ab_name(x, language = get_AMR_locale(), tolower = FALSE, ...)
|
||||
|
||||
ab_cid(x, ...)
|
||||
|
||||
@ -27,13 +27,13 @@ ab_synonyms(x, ...)
|
||||
|
||||
ab_tradenames(x, ...)
|
||||
|
||||
ab_group(x, language = get_locale(), ...)
|
||||
ab_group(x, language = get_AMR_locale(), ...)
|
||||
|
||||
ab_atc(x, only_first = FALSE, ...)
|
||||
|
||||
ab_atc_group1(x, language = get_locale(), ...)
|
||||
ab_atc_group1(x, language = get_AMR_locale(), ...)
|
||||
|
||||
ab_atc_group2(x, language = get_locale(), ...)
|
||||
ab_atc_group2(x, language = get_AMR_locale(), ...)
|
||||
|
||||
ab_loinc(x, ...)
|
||||
|
||||
@ -41,24 +41,24 @@ ab_ddd(x, administration = "oral", ...)
|
||||
|
||||
ab_ddd_units(x, administration = "oral", ...)
|
||||
|
||||
ab_info(x, language = get_locale(), ...)
|
||||
ab_info(x, language = get_AMR_locale(), ...)
|
||||
|
||||
ab_url(x, open = FALSE, ...)
|
||||
|
||||
ab_property(x, property = "name", language = get_locale(), ...)
|
||||
ab_property(x, property = "name", language = get_AMR_locale(), ...)
|
||||
|
||||
set_ab_names(
|
||||
data,
|
||||
...,
|
||||
property = "name",
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
snake_case = NULL
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{any (vector of) text that can be coerced to a valid antibiotic code with \code{\link[=as.ab]{as.ab()}}}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{tolower}{a \link{logical} to indicate whether the first \link{character} of every output should be transformed to a lower case \link{character}. This will lead to e.g. "polymyxin B" and not "polymyxin b".}
|
||||
|
||||
|
@ -16,7 +16,7 @@ as.mo(
|
||||
allow_uncertain = TRUE,
|
||||
reference_df = get_mo_source(),
|
||||
ignore_pattern = getOption("AMR_ignore_pattern"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
info = interactive(),
|
||||
...
|
||||
)
|
||||
@ -46,7 +46,7 @@ This excludes \emph{Enterococci} at default (who are in group D), use \code{Lanc
|
||||
|
||||
\item{ignore_pattern}{a regular expression (case-insensitive) of which all matches in \code{x} must return \code{NA}. This can be convenient to exclude known non-relevant input and can also be set with the option \code{AMR_ignore_pattern}, e.g. \code{options(AMR_ignore_pattern = "(not reported|contaminated flora)")}.}
|
||||
|
||||
\item{language}{language to translate text like "no growth", which defaults to the system language (see \code{\link[=get_locale]{get_locale()}})}
|
||||
\item{language}{language to translate text like "no growth", which defaults to the system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}})}
|
||||
|
||||
\item{info}{a \link{logical} to indicate if a progress bar should be printed if more than 25 items are to be coerced, defaults to \code{TRUE} only in interactive mode}
|
||||
|
||||
|
@ -13,7 +13,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
|
||||
\method{format}{bug_drug_combinations}(
|
||||
x,
|
||||
translate_ab = "name (ab, atc)",
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
minimum = 30,
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
@ -35,7 +35,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
|
||||
|
||||
\item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antibiotics} data set}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see \emph{Source}.}
|
||||
|
||||
|
@ -35,7 +35,7 @@ n_rsi(..., only_all_tested = FALSE)
|
||||
count_df(
|
||||
data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE
|
||||
)
|
||||
@ -49,7 +49,7 @@ count_df(
|
||||
|
||||
\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{combine_SI}{a \link{logical} to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.}
|
||||
|
||||
|
@ -22,7 +22,7 @@ ggplot_rsi(
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
nrow = NULL,
|
||||
colours = c(S = "#3CAEA3", SI = "#3CAEA3", I = "#F6D55C", IR = "#ED553B", R =
|
||||
"#ED553B"),
|
||||
@ -43,7 +43,7 @@ geom_rsi(
|
||||
fill = "interpretation",
|
||||
translate_ab = "name",
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
...
|
||||
@ -62,7 +62,7 @@ labels_rsi_count(
|
||||
x = "antibiotic",
|
||||
translate_ab = "name",
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
datalabels.size = 3,
|
||||
@ -92,7 +92,7 @@ labels_rsi_count(
|
||||
|
||||
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see \emph{Source}.}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{nrow}{(when using \code{facet}) number of rows}
|
||||
|
||||
|
@ -32,68 +32,68 @@
|
||||
\alias{mo_url}
|
||||
\title{Get Properties of a Microorganism}
|
||||
\usage{
|
||||
mo_name(x, language = get_locale(), ...)
|
||||
mo_name(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_fullname(x, language = get_locale(), ...)
|
||||
mo_fullname(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_shortname(x, language = get_locale(), ...)
|
||||
mo_shortname(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_subspecies(x, language = get_locale(), ...)
|
||||
mo_subspecies(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_species(x, language = get_locale(), ...)
|
||||
mo_species(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_genus(x, language = get_locale(), ...)
|
||||
mo_genus(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_family(x, language = get_locale(), ...)
|
||||
mo_family(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_order(x, language = get_locale(), ...)
|
||||
mo_order(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_class(x, language = get_locale(), ...)
|
||||
mo_class(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_phylum(x, language = get_locale(), ...)
|
||||
mo_phylum(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_kingdom(x, language = get_locale(), ...)
|
||||
mo_kingdom(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_domain(x, language = get_locale(), ...)
|
||||
mo_domain(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_type(x, language = get_locale(), ...)
|
||||
mo_type(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_gramstain(x, language = get_locale(), ...)
|
||||
mo_gramstain(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_is_gram_negative(x, language = get_locale(), ...)
|
||||
mo_is_gram_negative(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_is_gram_positive(x, language = get_locale(), ...)
|
||||
mo_is_gram_positive(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_is_yeast(x, language = get_locale(), ...)
|
||||
mo_is_yeast(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_is_intrinsic_resistant(x, ab, language = get_locale(), ...)
|
||||
mo_is_intrinsic_resistant(x, ab, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_snomed(x, language = get_locale(), ...)
|
||||
mo_snomed(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_ref(x, language = get_locale(), ...)
|
||||
mo_ref(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_authors(x, language = get_locale(), ...)
|
||||
mo_authors(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_year(x, language = get_locale(), ...)
|
||||
mo_year(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_lpsn(x, language = get_locale(), ...)
|
||||
mo_lpsn(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_rank(x, language = get_locale(), ...)
|
||||
mo_rank(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_taxonomy(x, language = get_locale(), ...)
|
||||
mo_taxonomy(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_synonyms(x, language = get_locale(), ...)
|
||||
mo_synonyms(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_info(x, language = get_locale(), ...)
|
||||
mo_info(x, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_url(x, open = FALSE, language = get_locale(), ...)
|
||||
mo_url(x, open = FALSE, language = get_AMR_locale(), ...)
|
||||
|
||||
mo_property(x, property = "fullname", language = get_locale(), ...)
|
||||
mo_property(x, property = "fullname", language = get_AMR_locale(), ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{any \link{character} (vector) that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see \emph{Examples}.}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Also used to translate text like "no growth". Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Also used to translate text like "no growth". Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{...}{other arguments passed on to \code{\link[=as.mo]{as.mo()}}, such as 'allow_uncertain' and 'ignore_pattern'}
|
||||
|
||||
|
12
man/plot.Rd
12
man/plot.Rd
@ -22,7 +22,7 @@
|
||||
ylab = "Frequency",
|
||||
xlab = "Minimum Inhibitory Concentration (mg/L)",
|
||||
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
expand = TRUE,
|
||||
...
|
||||
)
|
||||
@ -36,7 +36,7 @@
|
||||
ylab = "Frequency",
|
||||
xlab = "Minimum Inhibitory Concentration (mg/L)",
|
||||
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
expand = TRUE,
|
||||
...
|
||||
)
|
||||
@ -52,7 +52,7 @@
|
||||
ab = NULL,
|
||||
guideline = "EUCAST",
|
||||
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
expand = TRUE,
|
||||
...
|
||||
)
|
||||
@ -66,7 +66,7 @@
|
||||
xlab = "Disk diffusion diameter (mm)",
|
||||
guideline = "EUCAST",
|
||||
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
expand = TRUE,
|
||||
...
|
||||
)
|
||||
@ -87,7 +87,7 @@
|
||||
xlab = "Antimicrobial Interpretation",
|
||||
ylab = "Frequency",
|
||||
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
...
|
||||
)
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
|
||||
\item{colours_RSI}{colours to use for filling in the bars, must be a vector of three values (in the order R, S and I). The default colours are colour-blind friendly.}
|
||||
|
||||
\item{language}{language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant', defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant', defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{expand}{a \link{logical} to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled.}
|
||||
|
||||
|
@ -34,7 +34,7 @@ proportion_S(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE)
|
||||
proportion_df(
|
||||
data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_SI = TRUE,
|
||||
@ -44,7 +44,7 @@ proportion_df(
|
||||
rsi_df(
|
||||
data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
language = get_AMR_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_SI = TRUE,
|
||||
@ -64,7 +64,7 @@ rsi_df(
|
||||
|
||||
\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{combine_SI}{a \link{logical} to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.}
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
% Please edit documentation in R/translate.R
|
||||
\name{translate}
|
||||
\alias{translate}
|
||||
\alias{get_locale}
|
||||
\alias{get_AMR_locale}
|
||||
\title{Translate Strings from AMR Package}
|
||||
\usage{
|
||||
get_locale()
|
||||
get_AMR_locale()
|
||||
}
|
||||
\description{
|
||||
For language-dependent output of AMR functions, like \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}, \code{\link[=mo_type]{mo_type()}} and \code{\link[=ab_name]{ab_name()}}.
|
||||
@ -13,7 +13,7 @@ For language-dependent output of AMR functions, like \code{\link[=mo_name]{mo_na
|
||||
\details{
|
||||
Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://github.com/msberends/AMR/blob/main/data-raw/translations.tsv}. This file will be read by all functions where a translated output can be desired, like all \code{\link[=mo_property]{mo_*}} functions (such as \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}, \code{\link[=mo_type]{mo_type()}}, etc.) and \code{\link[=ab_property]{ab_*}} functions (such as \code{\link[=ab_name]{ab_name()}}, \code{\link[=ab_group]{ab_group()}}, etc.).
|
||||
|
||||
Currently supported languages are: Danish, Dutch, English, French, German, Italian, Portuguese and Spanish. All these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
Currently supported languages are: Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish. All these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
|
||||
Please suggest your own translations \href{https://github.com/msberends/AMR/issues/new?title=Translations}{by creating a new issue on our repository}.
|
||||
\subsection{Changing the Default Language}{
|
||||
@ -24,7 +24,7 @@ The system language will be used at default (as returned by \code{Sys.getenv("LA
|
||||
\item Setting the system variable \code{LANGUAGE} or \code{LANG}, e.g. by adding \code{LANGUAGE="de_DE.utf8"} to your \code{.Renviron} file in your home directory
|
||||
}
|
||||
|
||||
So if the R option \code{AMR_locale} is set, the system variables \code{LANGUAGE} and \code{LANG} will be ignored.
|
||||
Thus, if the R option \code{AMR_locale} is set, the system variables \code{LANGUAGE} and \code{LANG} will be ignored.
|
||||
}
|
||||
}
|
||||
\section{Stable Lifecycle}{
|
||||
@ -43,15 +43,15 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/
|
||||
\examples{
|
||||
# The 'language' argument of below functions
|
||||
# will be set automatically to your system language
|
||||
# with get_locale()
|
||||
# with get_AMR_locale()
|
||||
|
||||
# English
|
||||
mo_name("CoNS", language = "en")
|
||||
#> "Coagulase-negative Staphylococcus (CoNS)"
|
||||
|
||||
# Danish
|
||||
mo_name("CoNS", language = "nl")
|
||||
#> "Koagulase-negative stafylokokker (CoNS)"
|
||||
mo_name("CoNS", language = "da")
|
||||
#> "Koagulase-negative stafylokokker (KNS)"
|
||||
|
||||
# Dutch
|
||||
mo_name("CoNS", language = "nl")
|
||||
|
Reference in New Issue
Block a user