1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 11:01:55 +02:00

atc_ functions

This commit is contained in:
2019-01-26 23:22:56 +01:00
parent 5493e1f05d
commit f836722269
56 changed files with 1397 additions and 910 deletions

View File

@ -4,14 +4,38 @@
\alias{AMR-deprecated}
\alias{ratio}
\alias{guess_mo}
\alias{ab_property}
\alias{ab_atc}
\alias{ab_official}
\alias{ab_name}
\alias{ab_trivial_nl}
\alias{ab_certe}
\alias{ab_umcg}
\alias{ab_tradenames}
\title{Deprecated functions}
\usage{
ratio(x, ratio)
guess_mo(...)
ab_property(...)
ab_atc(...)
ab_official(...)
ab_name(...)
ab_trivial_nl(...)
ab_certe(...)
ab_umcg(...)
ab_tradenames(...)
}
\description{
These functions are \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.
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).
}
\section{Read more on our website!}{

View File

@ -9,7 +9,7 @@ Welcome to the \code{AMR} package. This page gives some additional contact infor
\details{
This package was intended to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods.
This package was created for academic research by PhD students of the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG).
This package was created for both academic research and routine analysis by PhD students of the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG).
}
\section{Read more on our website!}{

View File

@ -1,59 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab_property.R
\name{ab_property}
\alias{ab_property}
\alias{ab_atc}
\alias{ab_official}
\alias{ab_name}
\alias{ab_trivial_nl}
\alias{ab_certe}
\alias{ab_umcg}
\alias{ab_tradenames}
\title{Property of an antibiotic}
\usage{
ab_property(x, property = "official")
ab_atc(x)
ab_official(x, language = NULL)
ab_name(x, language = NULL)
ab_trivial_nl(x)
ab_certe(x)
ab_umcg(x)
ab_tradenames(x)
}
\arguments{
\item{x}{a (vector of a) valid \code{\link{atc}} code or any text that can be coerced to a valid atc with \code{\link{as.atc}}}
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set, like \code{"atc"} and \code{"official"}}
\item{language}{language of the returned text, defaults to English (\code{"en"}) and can be set with \code{\link{getOption}("AMR_locale")}. Either one of \code{"en"} (English) or \code{"nl"} (Dutch).}
}
\value{
A vector of values. In case of \code{ab_tradenames}, if \code{x} is of length one, a vector will be returned. Otherwise a \code{\link{list}}, with \code{x} as names.
}
\description{
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set, based on their ATC code. Get such a code with \code{\link{as.atc}}.
}
\section{Read more on our website!}{
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R.
}
\examples{
ab_atc("amcl") # J01CR02
ab_name("amcl") # Amoxicillin and beta-lactamase inhibitor
ab_name("amcl", "nl") # Amoxicilline met enzymremmer
ab_trivial_nl("amcl") # Amoxicilline/clavulaanzuur
ab_certe("amcl") # amcl
ab_umcg("amcl") # AMCL
}
\seealso{
\code{\link{antibiotics}}
}

73
man/atc_online.Rd Normal file
View File

@ -0,0 +1,73 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc_online.R
\name{atc_online_property}
\alias{atc_online_property}
\alias{atc_online_groups}
\alias{atc_online_ddd}
\title{Properties of an ATC code}
\source{
\url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/}
}
\usage{
atc_online_property(atc_code, property, administration = "O",
url = "https://www.whocc.no/atc_ddd_index/?code=\%s&showdescription=no")
atc_online_groups(atc_code, ...)
atc_online_ddd(atc_code, ...)
}
\arguments{
\item{atc_code}{a character or character vector with ATC code(s) of antibiotic(s)}
\item{property}{property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.}
\item{administration}{type of administration when using \code{property = "Adm.R"}, see Details}
\item{url}{url of website of the WHO. The sign \code{\%s} can be used as a placeholder for ATC codes.}
\item{...}{parameters to pass on to \code{atc_property}}
}
\description{
Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. \cr \strong{This function requires an internet connection.}
}
\details{
Options for parameter \code{administration}:
\itemize{
\item{\code{"Implant"}}{ = Implant}
\item{\code{"Inhal"}}{ = Inhalation}
\item{\code{"Instill"}}{ = Instillation}
\item{\code{"N"}}{ = nasal}
\item{\code{"O"}}{ = oral}
\item{\code{"P"}}{ = parenteral}
\item{\code{"R"}}{ = rectal}
\item{\code{"SL"}}{ = sublingual/buccal}
\item{\code{"TD"}}{ = transdermal}
\item{\code{"V"}}{ = vaginal}
}
Abbreviations of return values when using \code{property = "U"} (unit):
\itemize{
\item{\code{"g"}}{ = gram}
\item{\code{"mg"}}{ = milligram}
\item{\code{"mcg"}}{ = microgram}
\item{\code{"U"}}{ = unit}
\item{\code{"TU"}}{ = thousand units}
\item{\code{"MU"}}{ = million units}
\item{\code{"mmol"}}{ = millimole}
\item{\code{"ml"}}{ = milliliter (e.g. eyedrops)}
}
}
\examples{
\donttest{
# oral DDD (Defined Daily Dose) of amoxicillin
atc_online_property("J01CA04", "DDD", "O")
# parenteral DDD (Defined Daily Dose) of amoxicillin
atc_online_property("J01CA04", "DDD", "P")
atc_online_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin
# [1] "ANTIINFECTIVES FOR SYSTEMIC USE"
# [2] "ANTIBACTERIALS FOR SYSTEMIC USE"
# [3] "BETA-LACTAM ANTIBACTERIALS, PENICILLINS"
# [4] "Penicillins with extended spectrum"
}
}

View File

@ -1,77 +1,56 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc.R
% Please edit documentation in R/atc_property.R
\name{atc_property}
\alias{atc_property}
\alias{atc_groups}
\alias{atc_ddd}
\title{Properties of an ATC code}
\source{
\url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/}
}
\alias{atc_official}
\alias{atc_name}
\alias{atc_trivial_nl}
\alias{atc_certe}
\alias{atc_umcg}
\alias{atc_tradenames}
\title{Property of an antibiotic}
\usage{
atc_property(atc_code, property, administration = "O",
url = "https://www.whocc.no/atc_ddd_index/?code=\%s&showdescription=no")
atc_property(x, property = "official")
atc_groups(atc_code, ...)
atc_official(x, language = NULL)
atc_ddd(atc_code, ...)
atc_name(x, language = NULL)
atc_trivial_nl(x)
atc_certe(x)
atc_umcg(x)
atc_tradenames(x)
}
\arguments{
\item{atc_code}{a character or character vector with ATC code(s) of antibiotic(s)}
\item{x}{a (vector of a) valid \code{\link{atc}} code or any text that can be coerced to a valid atc with \code{\link{as.atc}}}
\item{property}{property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.}
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set, like \code{"atc"} and \code{"official"}}
\item{administration}{type of administration when using \code{property = "Adm.R"}, see Details}
\item{url}{url of website of the WHO. The sign \code{\%s} can be used as a placeholder for ATC codes.}
\item{...}{parameters to pass on to \code{atc_property}}
\item{language}{language of the returned text, defaults to English (\code{"en"}) and can be set with \code{\link{getOption}("AMR_locale")}. Either one of \code{"en"} (English) or \code{"nl"} (Dutch).}
}
\value{
A vector of values. In case of \code{atc_tradenames}, if \code{x} is of length one, a vector will be returned. Otherwise a \code{\link{list}}, with \code{x} as names.
}
\description{
Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. \cr \strong{This function requires an internet connection.}
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set, based on their ATC code. Get such a code with \code{\link{as.atc}}.
}
\details{
Options for parameter \code{administration}:
\itemize{
\item{\code{"Implant"}}{ = Implant}
\item{\code{"Inhal"}}{ = Inhalation}
\item{\code{"Instill"}}{ = Instillation}
\item{\code{"N"}}{ = nasal}
\item{\code{"O"}}{ = oral}
\item{\code{"P"}}{ = parenteral}
\item{\code{"R"}}{ = rectal}
\item{\code{"SL"}}{ = sublingual/buccal}
\item{\code{"TD"}}{ = transdermal}
\item{\code{"V"}}{ = vaginal}
\section{Read more on our website!}{
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R.
}
Abbreviations of return values when using \code{property = "U"} (unit):
\itemize{
\item{\code{"g"}}{ = gram}
\item{\code{"mg"}}{ = milligram}
\item{\code{"mcg"}}{ = microgram}
\item{\code{"U"}}{ = unit}
\item{\code{"TU"}}{ = thousand units}
\item{\code{"MU"}}{ = million units}
\item{\code{"mmol"}}{ = millimole}
\item{\code{"ml"}}{ = milliliter (e.g. eyedrops)}
}
}
\examples{
\donttest{
# What's the ATC of amoxicillin?
guess_atc("Amoxicillin")
# [1] "J01CA04"
# oral DDD (Defined Daily Dose) of amoxicillin
atc_property("J01CA04", "DDD", "O")
# parenteral DDD (Defined Daily Dose) of amoxicillin
atc_property("J01CA04", "DDD", "P")
atc_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin
# [1] "ANTIINFECTIVES FOR SYSTEMIC USE"
# [2] "ANTIBACTERIALS FOR SYSTEMIC USE"
# [3] "BETA-LACTAM ANTIBACTERIALS, PENICILLINS"
# [4] "Penicillins with extended spectrum"
as.atc("amcl") # J01CR02
atc_name("amcl") # Amoxicillin and beta-lactamase inhibitor
atc_name("amcl", "nl") # Amoxicilline met enzymremmer
atc_trivial_nl("amcl") # Amoxicilline/clavulaanzuur
atc_certe("amcl") # amcl
atc_umcg("amcl") # AMCL
}
\seealso{
\code{\link{antibiotics}}
}