mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 07:51:57 +02:00
(v0.7.1.9004) atc class removal
This commit is contained in:
@ -2,31 +2,10 @@
|
||||
% Please edit documentation in R/deprecated.R
|
||||
\name{AMR-deprecated}
|
||||
\alias{AMR-deprecated}
|
||||
\alias{ratio}
|
||||
\alias{abname}
|
||||
\alias{atc_property}
|
||||
\alias{atc_official}
|
||||
\alias{ab_official}
|
||||
\alias{atc_name}
|
||||
\alias{atc_trivial_nl}
|
||||
\alias{atc_tradenames}
|
||||
\alias{as.atc}
|
||||
\title{Deprecated functions}
|
||||
\usage{
|
||||
ratio(x, ratio)
|
||||
|
||||
abname(...)
|
||||
|
||||
atc_property(...)
|
||||
|
||||
atc_official(...)
|
||||
|
||||
ab_official(...)
|
||||
|
||||
atc_name(...)
|
||||
|
||||
atc_trivial_nl(...)
|
||||
|
||||
atc_tradenames(...)
|
||||
as.atc(x)
|
||||
}
|
||||
\description{
|
||||
These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).
|
||||
|
@ -31,7 +31,7 @@
|
||||
\item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?}
|
||||
\item{\code{Comment}}{Other comments}
|
||||
\item{\code{Date of data entry}}{Date this data was entered in WHONET}
|
||||
\item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{atc_name}("AMP")} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link{as.rsi}}.}
|
||||
\item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{ab_name}("AMP")} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link{as.rsi}}.}
|
||||
}}
|
||||
\usage{
|
||||
WHONET
|
||||
|
@ -1,55 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/atc.R
|
||||
\name{as.atc}
|
||||
\alias{as.atc}
|
||||
\alias{atc}
|
||||
\alias{is.atc}
|
||||
\title{Transform to ATC code}
|
||||
\usage{
|
||||
as.atc(x)
|
||||
|
||||
is.atc(x)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{character vector to determine \code{ATC} code}
|
||||
}
|
||||
\value{
|
||||
Character (vector) with class \code{"atc"}. Unknown values will return \code{NA}.
|
||||
}
|
||||
\description{
|
||||
Use this function to determine the ATC code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and trade names.
|
||||
}
|
||||
\details{
|
||||
Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples.
|
||||
|
||||
In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
|
||||
Source: \url{https://www.whocc.no/atc/structure_and_principles/}
|
||||
}
|
||||
\section{WHOCC}{
|
||||
|
||||
\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
|
||||
This package contains \strong{all ~450 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}).
|
||||
|
||||
These have become the gold standard for international drug utilisation monitoring and research.
|
||||
|
||||
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
||||
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
|
||||
}
|
||||
|
||||
\examples{
|
||||
# These examples all return "J01FA01", the ATC code of Erythromycin:
|
||||
as.atc("J01FA01")
|
||||
as.atc("Erythromycin")
|
||||
as.atc("eryt")
|
||||
as.atc(" eryt 123")
|
||||
as.atc("ERYT")
|
||||
as.atc("ERY")
|
||||
}
|
||||
\seealso{
|
||||
\code{\link{antibiotics}} for the dataframe that is being used to determine ATCs.
|
||||
}
|
||||
\keyword{atc}
|
@ -25,9 +25,9 @@ count_SI(..., also_single_tested = FALSE)
|
||||
|
||||
count_S(..., also_single_tested = FALSE)
|
||||
|
||||
count_all(...)
|
||||
count_all(..., also_single_tested = FALSE)
|
||||
|
||||
n_rsi(...)
|
||||
n_rsi(..., also_single_tested = FALSE)
|
||||
|
||||
count_df(data, translate_ab = "name", language = get_locale(),
|
||||
combine_SI = TRUE, combine_IR = FALSE)
|
||||
@ -35,7 +35,7 @@ count_df(data, translate_ab = "name", language = get_locale(),
|
||||
\arguments{
|
||||
\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed.}
|
||||
|
||||
\item{also_single_tested}{a logical to indicate whether (in combination therapies) also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of \code{portion_S} and R in case of \code{portion_R}). \strong{This would lead to selection bias in almost all cases.}}
|
||||
\item{also_single_tested}{a logical to indicate whether for combination therapies also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of \code{portion_S} and R in case of \code{portion_R}). \strong{This could lead to selection bias.}}
|
||||
|
||||
\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})}
|
||||
|
||||
|
@ -13,17 +13,16 @@
|
||||
ggplot_rsi(data, position = NULL, x = "antibiotic",
|
||||
fill = "interpretation", facet = NULL, breaks = seq(0, 1, 0.1),
|
||||
limits = NULL, translate_ab = "name", combine_SI = TRUE,
|
||||
combine_IR = FALSE, language = get_locale(), fun = count_df,
|
||||
nrow = NULL, colours = c(S = "#61a8ff", SI = "#61a8ff", I =
|
||||
"#61f7ff", IR = "#ff6961", R = "#ff6961"), datalabels = TRUE,
|
||||
datalabels.size = 2.5, datalabels.colour = "gray15", title = NULL,
|
||||
subtitle = NULL, caption = NULL, x.title = NULL, y.title = NULL,
|
||||
...)
|
||||
combine_IR = FALSE, language = get_locale(), nrow = NULL,
|
||||
colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR =
|
||||
"#ff6961", R = "#ff6961"), datalabels = TRUE, datalabels.size = 2.5,
|
||||
datalabels.colour = "gray15", title = NULL, subtitle = NULL,
|
||||
caption = NULL, x.title = NULL, y.title = NULL, ...)
|
||||
|
||||
geom_rsi(position = NULL, x = c("antibiotic", "interpretation"),
|
||||
fill = "interpretation", translate_ab = "name",
|
||||
language = get_locale(), combine_SI = TRUE, combine_IR = FALSE,
|
||||
fun = count_df, ...)
|
||||
...)
|
||||
|
||||
facet_rsi(facet = c("interpretation", "antibiotic"), nrow = NULL)
|
||||
|
||||
@ -61,13 +60,11 @@ labels_rsi_count(position = NULL, x = "antibiotic",
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{fun}{function to transform \code{data}, either \code{\link{count_df}} (default) or \code{\link{portion_df}}}
|
||||
|
||||
\item{nrow}{(when using \code{facet}) number of rows}
|
||||
|
||||
\item{colours}{a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be \code{FALSE} to use default \code{ggplot2} colours.}
|
||||
|
||||
\item{datalabels}{show datalabels using \code{labels_rsi_count}, will only be shown when \code{fun = count_df}}
|
||||
\item{datalabels}{show datalabels using \code{labels_rsi_count}}
|
||||
|
||||
\item{datalabels.size}{size of the datalabels}
|
||||
|
||||
@ -92,7 +89,7 @@ Use these functions to create bar plots for antimicrobial resistance analysis. A
|
||||
At default, the names of antibiotics will be shown on the plots using \code{\link{ab_name}}. This can be set with the \code{translate_ab} parameter. See \code{\link{count_df}}.
|
||||
|
||||
\strong{The functions}\cr
|
||||
\code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{fun} (\code{\link{count_df}} at default, can also be \code{\link{portion_df}}) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
|
||||
\code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{\link{rsi_df}} and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
|
||||
|
||||
\code{facet_rsi} creates 2d plots (at default based on S/I/R) using \code{\link[ggplot2]{facet_wrap}}.
|
||||
|
||||
@ -136,7 +133,7 @@ septic_patients \%>\%
|
||||
# get only portions and no counts:
|
||||
septic_patients \%>\%
|
||||
select(AMX, NIT, FOS, TMP, CIP) \%>\%
|
||||
ggplot_rsi(fun = portion_df)
|
||||
ggplot_rsi(datalabels = FALSE)
|
||||
|
||||
# add other ggplot2 parameters as you like:
|
||||
septic_patients \%>\%
|
||||
|
@ -188,7 +188,7 @@ mo_shortname("S. epi", Becker = TRUE) # "CoNS"
|
||||
mo_fullname("S. pyo") # "Streptococcus pyogenes"
|
||||
mo_fullname("S. pyo", Lancefield = TRUE) # "Streptococcus group A"
|
||||
mo_shortname("S. pyo") # "S. pyogenes"
|
||||
mo_shortname("S. pyo", Lancefield = TRUE) # "GAS" ('Group A streptococci')
|
||||
mo_shortname("S. pyo", Lancefield = TRUE) # "GAS" (='Group A Streptococci')
|
||||
|
||||
|
||||
# language support for German, Dutch, Spanish, Portuguese, Italian and French
|
||||
|
@ -46,7 +46,7 @@ rsi_df(data, translate_ab = "name", language = get_locale(),
|
||||
|
||||
\item{as_percent}{a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.}
|
||||
|
||||
\item{also_single_tested}{a logical to indicate whether (in combination therapies) also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of \code{portion_S} and R in case of \code{portion_R}). \strong{This would lead to selection bias in almost all cases.}}
|
||||
\item{also_single_tested}{a logical to indicate whether for combination therapies also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of \code{portion_S} and R in case of \code{portion_R}). \strong{This could lead to selection bias.}}
|
||||
|
||||
\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})}
|
||||
|
||||
@ -155,6 +155,15 @@ septic_patients \%>\% count_all(GEN) # n = 1855
|
||||
septic_patients \%>\% portion_S(AMC, GEN) # S = 92.3\%
|
||||
septic_patients \%>\% count_all(AMC, GEN) # n = 1798
|
||||
|
||||
# Using `also_single_tested` can be useful ...
|
||||
septic_patients \%>\%
|
||||
portion_S(AMC, GEN,
|
||||
also_single_tested = TRUE) # S = 92.6\%
|
||||
# ... but can also lead to selection bias - the data only has 2,000 rows:
|
||||
septic_patients \%>\%
|
||||
count_all(AMC, GEN,
|
||||
also_single_tested = TRUE) # n = 2555
|
||||
|
||||
|
||||
septic_patients \%>\%
|
||||
group_by(hospital_id) \%>\%
|
||||
|
@ -15,7 +15,7 @@
|
||||
\item{\code{gender}}{gender of the patient}
|
||||
\item{\code{patient_id}}{ID of the patient, first 10 characters of an SHA hash containing irretrievable information}
|
||||
\item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}}
|
||||
\item{\code{peni:rifa}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{abname}}}
|
||||
\item{\code{peni:rifa}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{ab_name}}}
|
||||
}}
|
||||
\usage{
|
||||
septic_patients
|
||||
|
Reference in New Issue
Block a user