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

(v1.7.1.9040) Support for Danish

This commit is contained in:
2021-09-29 12:12:35 +02:00
parent 5f433d6e5c
commit 93a4734b44
62 changed files with 911 additions and 823 deletions

View File

@ -3,13 +3,12 @@
\name{ab_property}
\alias{ab_property}
\alias{ab_name}
\alias{set_ab_names}
\alias{ATC}
\alias{ab_cid}
\alias{ab_synonyms}
\alias{ab_tradenames}
\alias{ab_group}
\alias{ab_atc}
\alias{ATC}
\alias{ab_atc_group1}
\alias{ab_atc_group2}
\alias{ab_loinc}
@ -17,17 +16,11 @@
\alias{ab_ddd_units}
\alias{ab_info}
\alias{ab_url}
\alias{set_ab_names}
\title{Get Properties of an Antibiotic}
\usage{
ab_name(x, language = get_locale(), tolower = FALSE, ...)
set_ab_names(
data,
property = "name",
language = get_locale(),
snake_case = property == "name"
)
ab_cid(x, ...)
ab_synonyms(x, ...)
@ -53,6 +46,13 @@ ab_info(x, language = get_locale(), ...)
ab_url(x, open = FALSE, ...)
ab_property(x, property = "name", language = get_locale(), ...)
set_ab_names(
data,
property = "name",
language = get_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()}}}
@ -63,17 +63,17 @@ ab_property(x, property = "name", language = get_locale(), ...)
\item{...}{other arguments passed on to \code{\link[=as.ab]{as.ab()}}}
\item{data}{a \link{data.frame} of which the columns need to be renamed}
\item{property}{one of the column names of one of the \link{antibiotics} data set: \code{vector_or(colnames(antibiotics), sort = FALSE)}.}
\item{snake_case}{a \link{logical} to indicate whether the names should be in so-called \href{https://en.wikipedia.org/wiki/Snake_case}{snake case}: in lower case and all spaces/slashes replaced with an underscore (\verb{_})}
\item{only_first}{a \link{logical} to indicate whether only the first ATC code must be returned, with giving preference to J0-codes (i.e., the antimicrobial drug group)}
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}
\item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}}
\item{property}{one of the column names of one of the \link{antibiotics} data set: \code{vector_or(colnames(antibiotics), sort = FALSE)}.}
\item{data}{a \link{data.frame} of which the columns need to be renamed, or a \link{character} vector of column names}
\item{snake_case}{a \link{logical} to indicate whether the names should be in so-called \href{https://en.wikipedia.org/wiki/Snake_case}{snake case}: in lower case and all spaces/slashes replaced with an underscore (\verb{_})}
}
\value{
\itemize{
@ -167,6 +167,11 @@ colnames(set_ab_names(example_isolates))
if (require("dplyr")) {
example_isolates \%>\%
set_ab_names()
# this does the same:
example_isolates \%>\%
rename_with(set_ab_names)
# set_ab_names() works with any AB property:
example_isolates \%>\%
set_ab_names("atc")

View File

@ -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/master/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: Dutch, English, French, German, Italian, Portuguese and Spanish. Please note that currently not 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 and Spanish. 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}{
@ -49,17 +49,17 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/
mo_name("CoNS", language = "en")
#> "Coagulase-negative Staphylococcus (CoNS)"
# German
mo_name("CoNS", language = "de")
#> "Koagulase-negative Staphylococcus (KNS)"
# Danish
mo_name("CoNS", language = "nl")
#> "Koagulase-negative stafylokokker (CoNS)"
# Dutch
mo_name("CoNS", language = "nl")
#> "Coagulase-negatieve Staphylococcus (CNS)"
# Spanish
mo_name("CoNS", language = "es")
#> "Staphylococcus coagulasa negativo (SCN)"
# German
mo_name("CoNS", language = "de")
#> "Koagulase-negative Staphylococcus (KNS)"
# Italian
mo_name("CoNS", language = "it")
@ -68,4 +68,8 @@ mo_name("CoNS", language = "it")
# Portuguese
mo_name("CoNS", language = "pt")
#> "Staphylococcus coagulase negativo (CoNS)"
# Spanish
mo_name("CoNS", language = "es")
#> "Staphylococcus coagulasa negativo (SCN)"
}