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

abname improvement, small fixes

This commit is contained in:
2018-08-13 11:00:53 +02:00
parent ce2cdb9309
commit dba06c3295
9 changed files with 201 additions and 165 deletions

17
man/abname.Rd Executable file → Normal file
View File

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc.R
% Please edit documentation in R/abname.R
\name{abname}
\alias{abname}
\title{Name of an antibiotic}
@ -13,7 +13,7 @@ abname(abcode, from = c("guess", "atc", "molis", "umcg"),
\arguments{
\item{abcode}{a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}}
\item{from, to}{type to transform from and to. See \code{\link{antibiotics}} for its column names. WIth \code{from = "guess"} the from will be guessed from \code{"atc"}, \code{"molis"} and \code{"umcg"}. When using \code{to = "atc"}, the ATC code will be search using \code{\link{guess_atc}}.}
\item{from, to}{type to transform from and to. See \code{\link{antibiotics}} for its column names. WIth \code{from = "guess"} the from will be guessed from \code{"atc"}, \code{"molis"} and \code{"umcg"}. When using \code{to = "atc"}, the ATC code will be searched using \code{\link{guess_atc}}.}
\item{textbetween}{text to put between multiple returned texts}
@ -26,11 +26,17 @@ Convert antibiotic codes (from a laboratory information system like MOLIS or GLI
abname("AMCL")
# "amoxicillin and enzyme inhibitor"
abname("AMCL+GENT")
# "amoxicillin and enzyme inhibitor + gentamicin"
# It is quite flexible at default (having `from = "guess"`)
abname(c("amox", "J01CA04", "Trimox", "dispermox", "Amoxil"))
# "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin"
# Multiple antibiotics can be combined with "+".
# The second antibiotic will be set to lower case when `tolower` was not set:
abname("AMCL+GENT", textbetween = "/")
# "amoxicillin and enzyme inhibitor/gentamicin"
abname(c("AMCL", "GENT"))
# "amoxicillin and enzyme inhibitor" "gentamicin"
# "Amoxicillin and beta-lactamase inhibitor" "Gentamicin"
abname("AMCL", to = "trivial_nl")
# "Amoxicilline/clavulaanzuur"
@ -38,6 +44,7 @@ abname("AMCL", to = "trivial_nl")
abname("AMCL", to = "atc")
# "J01CR02"
# specific codes for University Medical Center Groningen (UMCG):
abname("J01CR02", from = "atc", to = "umcg")
# "AMCL"
}

View File

@ -84,6 +84,6 @@ septic_patients \%>\%
select(hospital_id, amox, cipr) \%>\%
group_by(hospital_id) \%>\%
ggplot_rsi() +
facet_grid("hospital_id") +
facet_wrap("hospital_id", nrow = 1) +
labs(title = "AMR of Amoxicillin And Ciprofloxacine Per Hospital")
}