mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:02:19 +02:00
ab_info, other bug fixes
This commit is contained in:
@ -23,11 +23,11 @@ ab_synonyms(x, ...)
|
||||
|
||||
ab_tradenames(x, ...)
|
||||
|
||||
ab_group(x, ...)
|
||||
ab_group(x, language = get_locale(), ...)
|
||||
|
||||
ab_atc_group1(x, ...)
|
||||
ab_atc_group1(x, language = get_locale(), ...)
|
||||
|
||||
ab_atc_group2(x, ...)
|
||||
ab_atc_group2(x, language = get_locale(), ...)
|
||||
|
||||
ab_ddd(x, administration = "oral", units = FALSE, ...)
|
||||
|
||||
@ -51,7 +51,7 @@ ab_property(x, property = "name", language = get_locale(), ...)
|
||||
\value{
|
||||
\itemize{
|
||||
\item{An \code{integer} in case of \code{ab_cid}}
|
||||
\item{A named \code{list} in case of multiple \code{ab_synonyms}}
|
||||
\item{A named \code{list} in case of \code{ab_info} and multiple \code{ab_synonyms}/\code{ab_tradenames}}
|
||||
\item{A \code{double} in case of \code{ab_ddd}}
|
||||
\item{A \code{character} in all other cases}
|
||||
}
|
||||
@ -98,6 +98,8 @@ ab_ddd("AMX", "oral", units = TRUE) # "g"
|
||||
ab_ddd("AMX", "iv") # 1
|
||||
ab_ddd("AMX", "iv", units = TRUE) # "g"
|
||||
|
||||
ab_info("AMX") # all properties as a list
|
||||
|
||||
# all ab_* functions use as.ab() internally:
|
||||
ab_name("Fluclox") # "Flucloxacillin"
|
||||
ab_name("fluklox") # "Flucloxacillin"
|
||||
|
@ -2,9 +2,12 @@
|
||||
% Please edit documentation in R/ab.R
|
||||
\name{as.ab}
|
||||
\alias{as.ab}
|
||||
\alias{is.ab}
|
||||
\title{Transform to antibiotic ID}
|
||||
\usage{
|
||||
as.ab(x)
|
||||
|
||||
is.ab(x)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{character vector to determine to antibiotic ID}
|
||||
@ -56,7 +59,7 @@ as.ab("eryt")
|
||||
as.ab(" eryt 123")
|
||||
as.ab("ERYT")
|
||||
as.ab("ERY")
|
||||
as.ab("erytromicine") # spelled wrong
|
||||
as.ab("eritromicine") # spelled wrong, yet works
|
||||
as.ab("Erythrocin") # trade name
|
||||
as.ab("Romycin") # trade name
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/ab.R, R/atc.R
|
||||
\name{is.ab}
|
||||
\alias{is.ab}
|
||||
% Please edit documentation in R/atc.R
|
||||
\name{as.atc}
|
||||
\alias{as.atc}
|
||||
\alias{atc}
|
||||
\alias{is.atc}
|
||||
\title{Transform to ATC code}
|
||||
\usage{
|
||||
is.ab(x)
|
||||
|
||||
as.atc(x)
|
||||
|
||||
is.atc(x)
|
||||
@ -17,7 +14,7 @@ is.atc(x)
|
||||
\item{x}{character vector to determine \code{ATC} code}
|
||||
}
|
||||
\value{
|
||||
Character (vector) with class \code{"act"}. Unknown values will return \code{NA}.
|
||||
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.
|
||||
|
Reference in New Issue
Block a user