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

(v0.7.1.9036) preserve ab/mo classes in subsetting

This commit is contained in:
2019-08-12 14:48:09 +02:00
parent 1d423cca89
commit bd252a2984
23 changed files with 237 additions and 181 deletions

View File

@ -9,40 +9,43 @@
\alias{filter_2nd_cephalosporins}
\alias{filter_3rd_cephalosporins}
\alias{filter_4th_cephalosporins}
\alias{filter_5th_cephalosporins}
\alias{filter_fluoroquinolones}
\alias{filter_glycopeptides}
\alias{filter_macrolides}
\alias{filter_tetracyclines}
\title{Filter isolates on result in antibiotic class}
\usage{
filter_ab_class(tbl, ab_class, result = NULL, scope = "any", ...)
filter_ab_class(x, ab_class, result = NULL, scope = "any", ...)
filter_aminoglycosides(tbl, result = NULL, scope = "any", ...)
filter_aminoglycosides(x, result = NULL, scope = "any", ...)
filter_carbapenems(tbl, result = NULL, scope = "any", ...)
filter_carbapenems(x, result = NULL, scope = "any", ...)
filter_cephalosporins(tbl, result = NULL, scope = "any", ...)
filter_cephalosporins(x, result = NULL, scope = "any", ...)
filter_1st_cephalosporins(tbl, result = NULL, scope = "any", ...)
filter_1st_cephalosporins(x, result = NULL, scope = "any", ...)
filter_2nd_cephalosporins(tbl, result = NULL, scope = "any", ...)
filter_2nd_cephalosporins(x, result = NULL, scope = "any", ...)
filter_3rd_cephalosporins(tbl, result = NULL, scope = "any", ...)
filter_3rd_cephalosporins(x, result = NULL, scope = "any", ...)
filter_4th_cephalosporins(tbl, result = NULL, scope = "any", ...)
filter_4th_cephalosporins(x, result = NULL, scope = "any", ...)
filter_fluoroquinolones(tbl, result = NULL, scope = "any", ...)
filter_5th_cephalosporins(x, result = NULL, scope = "any", ...)
filter_glycopeptides(tbl, result = NULL, scope = "any", ...)
filter_fluoroquinolones(x, result = NULL, scope = "any", ...)
filter_macrolides(tbl, result = NULL, scope = "any", ...)
filter_glycopeptides(x, result = NULL, scope = "any", ...)
filter_tetracyclines(tbl, result = NULL, scope = "any", ...)
filter_macrolides(x, result = NULL, scope = "any", ...)
filter_tetracyclines(x, result = NULL, scope = "any", ...)
}
\arguments{
\item{tbl}{a data set}
\item{x}{a data set}
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. More specifically, this should be a text that can be found in a 4th level ATC group (chemical subgroup) or a 5th level ATC group (chemical substance), please see \href{https://www.whocc.no/atc/structure_and_principles/}{this explanation on the WHOCC website}.}
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group}}
\item{result}{an antibiotic result: S, I or R (or a combination of more of them)}
@ -54,7 +57,7 @@ filter_tetracyclines(tbl, result = NULL, scope = "any", ...)
Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside.
}
\details{
The \code{\link{antibiotics}} data set will be searched for \code{ab_class} in the columns \code{atc_group1} and \code{atc_group2} (case-insensitive). Next, \code{tbl} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set.
The \code{group} column in \code{\link{antibiotics}} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set.
}
\examples{
library(dplyr)