AMR/man/filter_ab_class.Rd

94 lines
3.3 KiB
Plaintext
Raw Normal View History

2019-03-05 22:47:42 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filter_ab_class.R
\name{filter_ab_class}
\alias{filter_ab_class}
\alias{filter_aminoglycosides}
\alias{filter_carbapenems}
\alias{filter_cephalosporins}
\alias{filter_1st_cephalosporins}
\alias{filter_2nd_cephalosporins}
\alias{filter_3rd_cephalosporins}
\alias{filter_4th_cephalosporins}
\alias{filter_5th_cephalosporins}
2019-03-05 22:47:42 +01:00
\alias{filter_fluoroquinolones}
\alias{filter_glycopeptides}
\alias{filter_macrolides}
\alias{filter_tetracyclines}
2019-03-26 14:24:03 +01:00
\title{Filter isolates on result in antibiotic class}
2019-03-05 22:47:42 +01:00
\usage{
filter_ab_class(x, ab_class, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_aminoglycosides(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_carbapenems(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_1st_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_2nd_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_3rd_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_4th_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_5th_cephalosporins(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_fluoroquinolones(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_glycopeptides(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
filter_macrolides(x, result = NULL, scope = "any", ...)
filter_tetracyclines(x, result = NULL, scope = "any", ...)
2019-03-05 22:47:42 +01:00
}
\arguments{
\item{x}{a data set}
2019-03-05 22:47:42 +01:00
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group}}
2019-03-05 22:47:42 +01:00
\item{result}{an antibiotic result: S, I or R (or a combination of more of them)}
\item{scope}{the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"}}
\item{...}{parameters passed on to \code{\link[dplyr]{filter_at}}}
}
\description{
2019-03-26 14:24:03 +01:00
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.
2019-03-05 22:47:42 +01:00
}
\details{
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.
2019-03-05 22:47:42 +01:00
}
\examples{
library(dplyr)
# filter on isolates that have any result for any aminoglycoside
example_isolates \%>\% filter_aminoglycosides()
2019-03-05 22:47:42 +01:00
2019-05-10 16:44:59 +02:00
# this is essentially the same as (but without determination of column names):
example_isolates \%>\%
2019-05-10 16:44:59 +02:00
filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
2019-03-05 22:47:42 +01:00
.vars_predicate = any_vars(. \%in\% c("S", "I", "R")))
# filter on isolates that show resistance to ANY aminoglycoside
example_isolates \%>\% filter_aminoglycosides("R")
2019-03-05 22:47:42 +01:00
# filter on isolates that show resistance to ALL aminoglycosides
example_isolates \%>\% filter_aminoglycosides("R", "all")
2019-03-05 22:47:42 +01:00
# filter on isolates that show resistance to
# any aminoglycoside and any fluoroquinolone
example_isolates \%>\%
2019-03-26 14:24:03 +01:00
filter_aminoglycosides("R") \%>\%
filter_fluoroquinolones("R")
# filter on isolates that show resistance to
# all aminoglycosides and all fluoroquinolones
example_isolates \%>\%
2019-03-26 14:24:03 +01:00
filter_aminoglycosides("R", "all") \%>\%
filter_fluoroquinolones("R", "all")
2019-03-05 22:47:42 +01:00
}
2019-03-06 09:32:48 +01:00
\keyword{fillter_class}
\keyword{filter}