1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 08:32:04 +02:00

(v0.7.1.9035) cephalosporins and unit tests

This commit is contained in:
2019-08-11 19:07:26 +02:00
parent 3f5828e74a
commit 1d423cca89
38 changed files with 382 additions and 361 deletions

View File

@ -29,13 +29,13 @@ is.rsi.eligible(x, threshold = 0.05)
\item{mo}{a microorganism code, generated with \code{\link{as.mo}}}
\item{ab}{an antibiotic code, generated with \code{\link{as.ab}}}
\item{ab}{an antimicrobial code, generated with \code{\link{as.ab}}}
\item{guideline}{defaults to the latest included EUCAST guideline, run \code{unique(AMR::rsi_translation$guideline)} for all options}
\item{col_mo}{column name of the unique IDs of the microorganisms (see \code{\link{mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.}
\item{threshold}{maximum fraction of \code{x} that is allowed to fail transformation, see Examples}
\item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, see Examples}
}
\value{
Ordered factor with new class \code{rsi}
@ -46,7 +46,7 @@ Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI value
\details{
Run \code{unique(AMR::rsi_translation$guideline)} for a list of all supported guidelines.
After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter.
}

View File

@ -5,7 +5,7 @@
\alias{\%like\%}
\title{Pattern Matching}
\source{
Idea from the \href{https://github.com/Rdatatable/data.table/blob/master/R/like.R}{\code{like} function from the \code{data.table} package}, but made it case insensitive at default and let it support multiple patterns.
Idea from the \href{https://github.com/Rdatatable/data.table/blob/master/R/like.R}{\code{like} function from the \code{data.table} package}, but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again with \code{perl = TRUE}.
}
\usage{
like(x, pattern)

View File

@ -8,16 +8,18 @@
get_locale()
}
\description{
For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}.
For language-dependent output of AMR functions, like \code{\link{mo_name}}, \code{\link{mo_type}} and \code{\link{ab_name}}.
}
\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://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}.
Currently supported languages can be found if running: \code{unique(AMR:::translations_file$lang)}.
Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}.
This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.).
The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
The system language will be used at default, if that language is supported. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
}
\section{Read more on our website!}{
@ -30,26 +32,26 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
# with get_locale()
# English
mo_fullname("CoNS", language = "en")
mo_name("CoNS", language = "en")
#> "Coagulase-negative Staphylococcus (CoNS)"
# German
mo_fullname("CoNS", language = "de")
mo_name("CoNS", language = "de")
#> "Koagulase-negative Staphylococcus (KNS)"
# Dutch
mo_fullname("CoNS", language = "nl")
mo_name("CoNS", language = "nl")
#> "Coagulase-negatieve Staphylococcus (CNS)"
# Spanish
mo_fullname("CoNS", language = "es")
mo_name("CoNS", language = "es")
#> "Staphylococcus coagulasa negativo (SCN)"
# Italian
mo_fullname("CoNS", language = "it")
mo_name("CoNS", language = "it")
#> "Staphylococcus negativo coagulasi (CoNS)"
# Portuguese
mo_fullname("CoNS", language = "pt")
mo_name("CoNS", language = "pt")
#> "Staphylococcus coagulase negativo (CoNS)"
}