2020-06-17 01:39:30 +02:00
% Generated by roxygen2: do not edit by hand
2021-12-09 10:48:25 +01:00
% Please edit documentation in R/ab_selectors.R
2020-06-17 01:39:30 +02:00
\name{antibiotic_class_selectors}
\alias{antibiotic_class_selectors}
2020-06-17 15:14:37 +02:00
\alias{ab_class}
2021-08-16 21:54:34 +02:00
\alias{ab_selector}
2020-06-17 01:39:30 +02:00
\alias{aminoglycosides}
2021-06-04 21:07:55 +02:00
\alias{aminopenicillins}
2021-08-16 21:54:34 +02:00
\alias{antifungals}
\alias{antimycobacterials}
2021-05-18 00:53:04 +02:00
\alias{betalactams}
2020-06-17 01:39:30 +02:00
\alias{carbapenems}
\alias{cephalosporins}
\alias{cephalosporins_1st}
\alias{cephalosporins_2nd}
\alias{cephalosporins_3rd}
\alias{cephalosporins_4th}
\alias{cephalosporins_5th}
\alias{fluoroquinolones}
\alias{glycopeptides}
2021-06-04 21:07:55 +02:00
\alias{lincosamides}
\alias{lipoglycopeptides}
2020-06-17 01:39:30 +02:00
\alias{macrolides}
2021-02-08 14:18:42 +01:00
\alias{oxazolidinones}
2020-06-17 01:39:30 +02:00
\alias{penicillins}
2021-06-04 21:07:55 +02:00
\alias{polymyxins}
\alias{streptogramins}
\alias{quinolones}
2020-06-17 01:39:30 +02:00
\alias{tetracyclines}
2021-08-16 21:54:34 +02:00
\alias{trimethoprims}
2021-06-04 21:07:55 +02:00
\alias{ureidopenicillins}
2021-12-09 10:48:25 +01:00
\alias{administrable_per_os}
\alias{administrable_iv}
\alias{not_intrinsic_resistant}
2021-08-16 21:54:34 +02:00
\title{Antibiotic Selectors}
2020-06-17 01:39:30 +02:00
\usage{
2023-01-21 23:47:20 +01:00
ab_class(ab_class, only_sir_columns = FALSE, only_treatable = TRUE, ...)
2020-06-17 15:14:37 +02:00
2023-01-21 23:47:20 +01:00
ab_selector(filter, only_sir_columns = FALSE, only_treatable = TRUE, ...)
2021-08-16 21:54:34 +02:00
2023-01-21 23:47:20 +01:00
aminoglycosides(only_sir_columns = FALSE, only_treatable = TRUE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
aminopenicillins(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
antifungals(only_sir_columns = FALSE, ...)
2021-08-16 21:54:34 +02:00
2023-01-21 23:47:20 +01:00
antimycobacterials(only_sir_columns = FALSE, ...)
2021-08-16 21:54:34 +02:00
2023-01-21 23:47:20 +01:00
betalactams(only_sir_columns = FALSE, only_treatable = TRUE, ...)
2021-05-18 00:53:04 +02:00
2023-01-21 23:47:20 +01:00
carbapenems(only_sir_columns = FALSE, only_treatable = TRUE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins_1st(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins_2nd(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins_3rd(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins_4th(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
cephalosporins_5th(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
fluoroquinolones(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
glycopeptides(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
lincosamides(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
lipoglycopeptides(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
macrolides(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
oxazolidinones(only_sir_columns = FALSE, ...)
2020-06-17 01:39:30 +02:00
2023-01-21 23:47:20 +01:00
penicillins(only_sir_columns = FALSE, ...)
2021-02-08 14:18:42 +01:00
2023-01-21 23:47:20 +01:00
polymyxins(only_sir_columns = FALSE, only_treatable = TRUE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
streptogramins(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
quinolones(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
tetracyclines(only_sir_columns = FALSE, ...)
2021-06-04 21:07:55 +02:00
2023-01-21 23:47:20 +01:00
trimethoprims(only_sir_columns = FALSE, ...)
2021-08-16 21:54:34 +02:00
2023-01-21 23:47:20 +01:00
ureidopenicillins(only_sir_columns = FALSE, ...)
2021-12-09 10:48:25 +01:00
2023-01-21 23:47:20 +01:00
administrable_per_os(only_sir_columns = FALSE, ...)
2021-12-09 10:48:25 +01:00
2023-01-21 23:47:20 +01:00
administrable_iv(only_sir_columns = FALSE, ...)
2021-12-09 10:48:25 +01:00
not_intrinsic_resistant(
2023-01-21 23:47:20 +01:00
only_sir_columns = FALSE,
2021-12-09 10:48:25 +01:00
col_mo = NULL,
version_expertrules = 3.3,
...
)
2020-06-17 01:39:30 +02:00
}
2020-06-17 15:14:37 +02:00
\arguments{
2021-08-19 23:43:02 +02:00
\item{ab_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
2021-02-02 23:57:35 +01:00
2023-02-22 14:38:57 +01:00
\item{only_sir_columns}{a \link{logical} to indicate whether only columns of class \code{sir} must be selected (default is \code{FALSE}), see \code{\link[=as.sir]{as.sir()}}}
2021-07-08 22:23:28 +02:00
2023-02-22 14:38:57 +01:00
\item{only_treatable}{a \link{logical} to indicate whether antimicrobial drugs should be excluded that are only for laboratory tests (default is \code{TRUE}), such as gentamicin-high (\code{GEH}) and imipenem/EDTA (\code{IPE})}
2021-08-16 21:54:34 +02:00
2021-08-17 14:34:11 +02:00
\item{...}{ignored, only in place to allow future extensions}
2021-08-16 21:54:34 +02:00
\item{filter}{an \link{expression} to be evaluated in the \link{antibiotics} data set, such as \code{name \%like\% "trim"}}
2021-12-09 10:48:25 +01:00
2023-02-22 14:38:57 +01:00
\item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
2021-12-09 10:48:25 +01:00
2023-02-22 14:38:57 +01:00
\item{version_expertrules}{the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either "3.3", "3.2", or "3.1".}
2021-08-16 21:54:34 +02:00
}
\value{
(internally) a \link{character} vector of column names, with additional class \code{"ab_selector"}
2020-06-17 15:14:37 +02:00
}
2020-06-17 01:39:30 +02:00
\description{
2023-03-11 16:54:02 +01:00
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class or group (according to the \link{antibiotics} data set), without the need to define the columns or antibiotic abbreviations.
In short, if you have a column name that resembles an antimicrobial drug, it will be picked up by any of these functions that matches its pharmaceutical class: "cefazolin", "kefzol", "CZO" and "J01DB04" will all be picked up by \code{\link[=cephalosporins]{cephalosporins()}}.
2020-06-17 01:39:30 +02:00
}
\details{
2023-03-11 16:54:02 +01:00
These functions can be used in data set calls for selecting columns and filtering rows. They work with base \R, the Tidyverse, and \code{data.table}. They are heavily inspired by the \link[tidyselect:language]{Tidyverse selection helpers} such as \code{\link[tidyselect:everything]{everything()}}, but are not limited to \code{dplyr} verbs. Nonetheless, they are very convenient to use with \code{dplyr} functions such as \code{\link[dplyr:select]{select()}}, \code{\link[dplyr:filter]{filter()}} and \code{\link[dplyr:summarise]{summarise()}}, see \emph{Examples}.
2021-05-19 22:55:42 +02:00
2021-08-16 21:54:34 +02:00
All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antibiotics} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
2021-08-19 23:43:02 +02:00
The \code{\link[=ab_class]{ab_class()}} function can be used to filter/select on a manually defined antibiotic class. It searches for results in the \link{antibiotics} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}.
2021-08-16 21:54:34 +02:00
The \code{\link[=ab_selector]{ab_selector()}} function can be used to internally filter the \link{antibiotics} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set.
The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antibiotics} data set - antibiotic columns will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antibiotics} data set.
2021-12-09 10:48:25 +01:00
2022-03-24 23:05:04 +01:00
The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antibiotic columns that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance.
2021-06-04 21:07:55 +02:00
}
2021-08-16 21:54:34 +02:00
\section{Full list of supported (antibiotic) classes}{
2021-06-04 21:07:55 +02:00
\itemize{
2023-02-22 14:38:57 +01:00
\item \code{\link[=aminoglycosides]{aminoglycosides()}} can select: \cr amikacin (AMK), amikacin/fosfomycin (AKF), amphotericin B-high (AMH), apramycin (APR), arbekacin (ARB), astromicin (AST), bekanamycin (BEK), dibekacin (DKB), framycetin (FRM), gentamicin (GEN), gentamicin-high (GEH), habekacin (HAB), hygromycin (HYG), isepamicin (ISE), kanamycin (KAN), kanamycin-high (KAH), kanamycin/cephalexin (KAC), micronomicin (MCR), neomycin (NEO), netilmicin (NET), pentisomicin (PIM), plazomicin (PLZ), propikacin (PKA), ribostamycin (RST), sisomicin (SIS), streptoduocin (STR), streptomycin (STR1), streptomycin-high (STH), tobramycin (TOB), and tobramycin-high (TOH)
2021-08-16 21:54:34 +02:00
\item \code{\link[=aminopenicillins]{aminopenicillins()}} can select: \cr amoxicillin (AMX) and ampicillin (AMP)
2023-02-22 14:38:57 +01:00
\item \code{\link[=antifungals]{antifungals()}} can select: \cr amphotericin B (AMB), anidulafungin (ANI), butoconazole (BUT), caspofungin (CAS), ciclopirox (CIX), clotrimazole (CTR), econazole (ECO), fluconazole (FLU), flucytosine (FCT), fosfluconazole (FFL), griseofulvin (GRI), hachimycin (HCH), ibrexafungerp (IBX), isavuconazole (ISV), isoconazole (ISO), itraconazole (ITR), ketoconazole (KET), manogepix (MGX), micafungin (MIF), miconazole (MCZ), nystatin (NYS), oteseconazole (OTE), pimaricin (PMR), posaconazole (POS), rezafungin (RZF), ribociclib (RBC), sulconazole (SUC), terbinafine (TRB), terconazole (TRC), and voriconazole (VOR)
\item \code{\link[=antimycobacterials]{antimycobacterials()}} can select: \cr 4-aminosalicylic acid (AMA), calcium aminosalicylate (CLA), capreomycin (CAP), clofazimine (CLF), delamanid (DLM), enviomycin (ENV), ethambutol (ETH), ethambutol/isoniazid (ETI), ethionamide (ETI1), isoniazid (INH), isoniazid/sulfamethoxazole/trimethoprim/pyridoxine (IST), morinamide (MRN), p-aminosalicylic acid (PAS), pretomanid (PMD), protionamide (PTH), pyrazinamide (PZA), rifabutin (RIB), rifampicin (RIF), rifampicin/ethambutol/isoniazid (REI), rifampicin/isoniazid (RFI), rifampicin/pyrazinamide/ethambutol/isoniazid (RPEI), rifampicin/pyrazinamide/isoniazid (RPI), rifamycin (RFM), rifapentine (RFP), simvastatin/fenofibrate (SMF), sodium aminosalicylate (SDA), streptomycin/isoniazid (STI), terizidone (TRZ), thioacetazone (TAT), thioacetazone/isoniazid (THI1), tiocarlide (TCR), and viomycin (VIO)
\item \code{\link[=betalactams]{betalactams()}} can select: \cr amoxicillin (AMX), amoxicillin/clavulanic acid (AMC), amoxicillin/sulbactam (AXS), ampicillin (AMP), ampicillin/sulbactam (SAM), apalcillin (APL), aspoxicillin (APX), avibactam (AVB), azidocillin (AZD), azlocillin (AZL), aztreonam (ATM), aztreonam/avibactam (AZA), aztreonam/nacubactam (ANC), bacampicillin (BAM), benzathine benzylpenicillin (BNB), benzathine phenoxymethylpenicillin (BNP), benzylpenicillin (PEN), biapenem (BIA), carbenicillin (CRB), carindacillin (CRN), cefacetrile (CAC), cefaclor (CEC), cefadroxil (CFR), cefalexin (LEX), cefaloridine (RID), cefalotin (CEP), cefamandole (MAN), cefapirin (HAP), cefatrizine (CTZ), cefazedone (CZD), cefazolin (CZO), cefcapene (CCP), cefcapene pivoxil (CCX), cefdinir (CDR), cefditoren (DIT), cefditoren pivoxil (DIX), cefepime (FEP), cefepime/clavulanic acid (CPC), cefepime/nacubactam (FNC), cefepime/tazobactam (FPT), cefetamet (CAT), cefetamet pivoxil (CPI), cefetecol (CCL), cefetrizole (CZL), cefixime (CFM), cefmenoxime (CMX), cefmetazole (CMZ), cefodizime (DIZ), cefonicid (CID), cefoperazone (CFP), cefoperazone/sulbactam (CSL), ceforanide (CND), cefoselis (CSE), cefotaxime (CTX), cefotaxime/clavulanic acid (CTC), cefotaxime/sulbactam (CTS), cefotetan (CTT), cefotiam (CTF), cefotiam hexetil (CHE), cefovecin (FOV), cefoxitin (FOX), cefoxitin screening (FOX1), cefozopran (ZOP), cefpimizole (CFZ), cefpiramide (CPM), cefpirome (CPO), cefpodoxime (CPD), cefpodoxime proxetil (CPX), cefpodoxime/clavulanic acid (CDC), cefprozil (CPR), cefquinome (CEQ), cefroxadine (CRD), cefsulodin (CFS), cefsumide (CSU), ceftaroline (CPT), ceftaroline/avibactam (CPA), ceftazidime (CAZ), ceftazidime/avibactam (CZA), ceftazidime/clavulanic acid (CCV), cefteram (CEM), cefteram pivoxil (CPL), ceftezole (CTL), ceftibuten (CTB), ceftiofur (TIO), ceftizoxime (CZX), ceftizoxime alapivoxil (CZP), ceftobiprole (BPR), ceftobiprole medocaril (CFM1), ceftolozane/tazobactam (CZT), ceftriaxone (CRO), ceftriaxone/beta-lactamase inhibitor (CEB), cefuroxime (CXM), cefuroxime axetil (CXA), cephradine (CED), ciclacillin (CIC), clometocillin (CLM), cloxacillin (CLO), dicloxacillin (DIC), doripenem (DOR), epicillin (EPC), ertapenem (ETP), flucloxacillin (FLC), hetacillin (HET), imipenem (IPM), imipenem/EDTA (IPE), imipenem/relebactam (IMR), latamoxef (LTM), lenampicillin (LEN), loracarbef (LOR), mecillinam (MEC), meropenem (MEM), meropenem/nacubactam (MNC), meropenem/vaborbactam (MEV), metampicillin (MTM), meticillin (MET), mezlocillin (MEZ), mezlocillin/sulbactam (MSU), nacubactam (NAC), nafcillin (NAF), oxacillin (OXA), panipenem (PAN), penamecillin (PNM), penicillin/novobiocin (PNO), penicillin/sulbactam (PSU), pheneticillin (PHE), phenoxymethylpenicillin (PHN), piperacillin (PIP), piperacillin/sulbactam (PIS), piperacillin/tazobactam (TZP), piridicillin (PRC), pivampicillin (PVM), pivmecillinam (PME), procaine benzylpenicillin (PRB), propicillin (PRP), razupenem (RZM), ritipenem (RIT), ritipenem acoxil (RIA), sarmoxicillin (SRX), sulbactam (SUL), sulbenicillin (SBC), sultamicillin (SLT6), talampicillin (TAL), tazobactam (TAZ), tebipenem (TBP), temocillin (TEM), ticarcillin (TIC), and ticarcillin/clavulanic acid (TCC)
\item \code{\link[=carbapenems]{carbapenems()}} can select: \cr biapenem (BIA), doripenem (DOR), ertapenem (ETP), imipenem (IPM), imipenem/EDTA (IPE), imipenem/relebactam (IMR), meropenem (MEM), meropenem/nacubactam (MNC), meropenem/vaborbactam (MEV), panipenem (PAN), razupenem (RZM), ritipenem (RIT), ritipenem acoxil (RIA), and tebipenem (TBP)
\item \code{\link[=cephalosporins]{cephalosporins()}} can select: \cr cefacetrile (CAC), cefaclor (CEC), cefadroxil (CFR), cefalexin (LEX), cefaloridine (RID), cefalotin (CEP), cefamandole (MAN), cefapirin (HAP), cefatrizine (CTZ), cefazedone (CZD), cefazolin (CZO), cefcapene (CCP), cefcapene pivoxil (CCX), cefdinir (CDR), cefditoren (DIT), cefditoren pivoxil (DIX), cefepime (FEP), cefepime/clavulanic acid (CPC), cefepime/tazobactam (FPT), cefetamet (CAT), cefetamet pivoxil (CPI), cefetecol (CCL), cefetrizole (CZL), cefixime (CFM), cefmenoxime (CMX), cefmetazole (CMZ), cefodizime (DIZ), cefonicid (CID), cefoperazone (CFP), cefoperazone/sulbactam (CSL), ceforanide (CND), cefoselis (CSE), cefotaxime (CTX), cefotaxime/clavulanic acid (CTC), cefotaxime/sulbactam (CTS), cefotetan (CTT), cefotiam (CTF), cefotiam hexetil (CHE), cefovecin (FOV), cefoxitin (FOX), cefoxitin screening (FOX1), cefozopran (ZOP), cefpimizole (CFZ), cefpiramide (CPM), cefpirome (CPO), cefpodoxime (CPD), cefpodoxime proxetil (CPX), cefpodoxime/clavulanic acid (CDC), cefprozil (CPR), cefquinome (CEQ), cefroxadine (CRD), cefsulodin (CFS), cefsumide (CSU), ceftaroline (CPT), ceftaroline/avibactam (CPA), ceftazidime (CAZ), ceftazidime/avibactam (CZA), ceftazidime/clavulanic acid (CCV), cefteram (CEM), cefteram pivoxil (CPL), ceftezole (CTL), ceftibuten (CTB), ceftiofur (TIO), ceftizoxime (CZX), ceftizoxime alapivoxil (CZP), ceftobiprole (BPR), ceftobiprole medocaril (CFM1), ceftolozane/tazobactam (CZT), ceftriaxone (CRO), ceftriaxone/beta-lactamase inhibitor (CEB), cefuroxime (CXM), cefuroxime axetil (CXA), cephradine (CED), latamoxef (LTM), and loracarbef (LOR)
\item \code{\link[=cephalosporins_1st]{cephalosporins_1st()}} can select: \cr cefacetrile (CAC), cefadroxil (CFR), cefalexin (LEX), cefaloridine (RID), cefalotin (CEP), cefapirin (HAP), cefatrizine (CTZ), cefazedone (CZD), cefazolin (CZO), cefroxadine (CRD), ceftezole (CTL), and cephradine (CED)
\item \code{\link[=cephalosporins_2nd]{cephalosporins_2nd()}} can select: \cr cefaclor (CEC), cefamandole (MAN), cefmetazole (CMZ), cefonicid (CID), ceforanide (CND), cefotetan (CTT), cefotiam (CTF), cefoxitin (FOX), cefoxitin screening (FOX1), cefprozil (CPR), cefuroxime (CXM), cefuroxime axetil (CXA), and loracarbef (LOR)
\item \code{\link[=cephalosporins_3rd]{cephalosporins_3rd()}} can select: \cr cefcapene (CCP), cefcapene pivoxil (CCX), cefdinir (CDR), cefditoren (DIT), cefditoren pivoxil (DIX), cefetamet (CAT), cefetamet pivoxil (CPI), cefixime (CFM), cefmenoxime (CMX), cefodizime (DIZ), cefoperazone (CFP), cefoperazone/sulbactam (CSL), cefotaxime (CTX), cefotaxime/clavulanic acid (CTC), cefotaxime/sulbactam (CTS), cefotiam hexetil (CHE), cefovecin (FOV), cefpimizole (CFZ), cefpiramide (CPM), cefpodoxime (CPD), cefpodoxime proxetil (CPX), cefpodoxime/clavulanic acid (CDC), cefsulodin (CFS), ceftazidime (CAZ), ceftazidime/avibactam (CZA), ceftazidime/clavulanic acid (CCV), cefteram (CEM), cefteram pivoxil (CPL), ceftibuten (CTB), ceftiofur (TIO), ceftizoxime (CZX), ceftizoxime alapivoxil (CZP), ceftriaxone (CRO), ceftriaxone/beta-lactamase inhibitor (CEB), and latamoxef (LTM)
\item \code{\link[=cephalosporins_4th]{cephalosporins_4th()}} can select: \cr cefepime (FEP), cefepime/clavulanic acid (CPC), cefepime/tazobactam (FPT), cefetecol (CCL), cefoselis (CSE), cefozopran (ZOP), cefpirome (CPO), and cefquinome (CEQ)
\item \code{\link[=cephalosporins_5th]{cephalosporins_5th()}} can select: \cr ceftaroline (CPT), ceftaroline/avibactam (CPA), ceftobiprole (BPR), ceftobiprole medocaril (CFM1), and ceftolozane/tazobactam (CZT)
\item \code{\link[=fluoroquinolones]{fluoroquinolones()}} can select: \cr besifloxacin (BES), ciprofloxacin (CIP), clinafloxacin (CLX), danofloxacin (DAN), delafloxacin (DFX), difloxacin (DIF), enoxacin (ENX), enrofloxacin (ENR), finafloxacin (FIN), fleroxacin (FLE), garenoxacin (GRN), gatifloxacin (GAT), gemifloxacin (GEM), grepafloxacin (GRX), lascufloxacin (LSC), levofloxacin (LVX), levonadifloxacin (LND), lomefloxacin (LOM), marbofloxacin (MAR), metioxate (MXT), miloxacin (MIL), moxifloxacin (MFX), nadifloxacin (NAD), nifuroquine (NIF), norfloxacin (NOR), ofloxacin (OFX), orbifloxacin (ORB), pazufloxacin (PAZ), pefloxacin (PEF), pradofloxacin (PRA), premafloxacin (PRX), prulifloxacin (PRU), rufloxacin (RFL), sarafloxacin (SAR), sitafloxacin (SIT), sparfloxacin (SPX), temafloxacin (TMX), tilbroquinol (TBQ), tioxacin (TXC), tosufloxacin (TFX), and trovafloxacin (TVA)
\item \code{\link[=glycopeptides]{glycopeptides()}} can select: \cr avoparcin (AVO), dalbavancin (DAL), norvancomycin (NVA), oritavancin (ORI), ramoplanin (RAM), teicoplanin (TEC), teicoplanin-macromethod (TCM), telavancin (TLV), vancomycin (VAN), and vancomycin-macromethod (VAM)
\item \code{\link[=lincosamides]{lincosamides()}} can select: \cr acetylmidecamycin (ACM), acetylspiramycin (ASP), clindamycin (CLI), gamithromycin (GAM), kitasamycin (KIT), lincomycin (LIN), meleumycin (MEL), nafithromycin (ZWK), pirlimycin (PRL), primycin (PRM), solithromycin (SOL), tildipirosin (TIP), tilmicosin (TIL), tulathromycin (TUL), tylosin (TYL), and tylvalosin (TYL1)
\item \code{\link[=lipoglycopeptides]{lipoglycopeptides()}} can select: \cr dalbavancin (DAL), oritavancin (ORI), and telavancin (TLV)
\item \code{\link[=macrolides]{macrolides()}} can select: \cr acetylmidecamycin (ACM), acetylspiramycin (ASP), azithromycin (AZM), clarithromycin (CLR), dirithromycin (DIR), erythromycin (ERY), flurithromycin (FLR1), gamithromycin (GAM), josamycin (JOS), kitasamycin (KIT), meleumycin (MEL), midecamycin (MID), miocamycin (MCM), nafithromycin (ZWK), oleandomycin (OLE), pirlimycin (PRL), primycin (PRM), rokitamycin (ROK), roxithromycin (RXT), solithromycin (SOL), spiramycin (SPI), telithromycin (TLT), tildipirosin (TIP), tilmicosin (TIL), troleandomycin (TRL), tulathromycin (TUL), tylosin (TYL), and tylvalosin (TYL1)
\item \code{\link[=oxazolidinones]{oxazolidinones()}} can select: \cr cadazolid (CDZ), cycloserine (CYC), linezolid (LNZ), tedizolid (TZD), and thiacetazone (THA)
\item \code{\link[=penicillins]{penicillins()}} can select: \cr amoxicillin (AMX), amoxicillin/clavulanic acid (AMC), amoxicillin/sulbactam (AXS), ampicillin (AMP), ampicillin/sulbactam (SAM), apalcillin (APL), aspoxicillin (APX), avibactam (AVB), azidocillin (AZD), azlocillin (AZL), aztreonam (ATM), aztreonam/avibactam (AZA), aztreonam/nacubactam (ANC), bacampicillin (BAM), benzathine benzylpenicillin (BNB), benzathine phenoxymethylpenicillin (BNP), benzylpenicillin (PEN), carbenicillin (CRB), carindacillin (CRN), cefepime/nacubactam (FNC), ciclacillin (CIC), clometocillin (CLM), cloxacillin (CLO), dicloxacillin (DIC), epicillin (EPC), flucloxacillin (FLC), hetacillin (HET), lenampicillin (LEN), mecillinam (MEC), metampicillin (MTM), meticillin (MET), mezlocillin (MEZ), mezlocillin/sulbactam (MSU), nacubactam (NAC), nafcillin (NAF), oxacillin (OXA), penamecillin (PNM), penicillin/novobiocin (PNO), penicillin/sulbactam (PSU), pheneticillin (PHE), phenoxymethylpenicillin (PHN), piperacillin (PIP), piperacillin/sulbactam (PIS), piperacillin/tazobactam (TZP), piridicillin (PRC), pivampicillin (PVM), pivmecillinam (PME), procaine benzylpenicillin (PRB), propicillin (PRP), sarmoxicillin (SRX), sulbactam (SUL), sulbenicillin (SBC), sultamicillin (SLT6), talampicillin (TAL), tazobactam (TAZ), temocillin (TEM), ticarcillin (TIC), and ticarcillin/clavulanic acid (TCC)
\item \code{\link[=polymyxins]{polymyxins()}} can select: \cr colistin (COL), polymyxin B (PLB), and polymyxin B/polysorbate 80 (POP)
\item \code{\link[=quinolones]{quinolones()}} can select: \cr besifloxacin (BES), cinoxacin (CIN), ciprofloxacin (CIP), clinafloxacin (CLX), danofloxacin (DAN), delafloxacin (DFX), difloxacin (DIF), enoxacin (ENX), enrofloxacin (ENR), finafloxacin (FIN), fleroxacin (FLE), flumequine (FLM), garenoxacin (GRN), gatifloxacin (GAT), gemifloxacin (GEM), grepafloxacin (GRX), lascufloxacin (LSC), levofloxacin (LVX), levonadifloxacin (LND), lomefloxacin (LOM), marbofloxacin (MAR), metioxate (MXT), miloxacin (MIL), moxifloxacin (MFX), nadifloxacin (NAD), nalidixic acid (NAL), nemonoxacin (NEM), nifuroquine (NIF), nitroxoline (NTR), norfloxacin (NOR), ofloxacin (OFX), orbifloxacin (ORB), oxolinic acid (OXO), pazufloxacin (PAZ), pefloxacin (PEF), pipemidic acid (PPA), piromidic acid (PIR), pradofloxacin (PRA), premafloxacin (PRX), prulifloxacin (PRU), rosoxacin (ROS), rufloxacin (RFL), sarafloxacin (SAR), sitafloxacin (SIT), sparfloxacin (SPX), temafloxacin (TMX), tilbroquinol (TBQ), tioxacin (TXC), tosufloxacin (TFX), and trovafloxacin (TVA)
2021-08-16 21:54:34 +02:00
\item \code{\link[=streptogramins]{streptogramins()}} can select: \cr pristinamycin (PRI) and quinupristin/dalfopristin (QDA)
2023-02-22 14:38:57 +01:00
\item \code{\link[=tetracyclines]{tetracyclines()}} can select: \cr cetocycline (CTO), chlortetracycline (CTE), clomocycline (CLM1), demeclocycline (DEM), doxycycline (DOX), eravacycline (ERV), lymecycline (LYM), metacycline (MTC), minocycline (MNO), omadacycline (OMC), oxytetracycline (OXY), penimepicycline (PNM1), rolitetracycline (RLT), sarecycline (SRC), tetracycline (TCY), and tigecycline (TGC)
\item \code{\link[=trimethoprims]{trimethoprims()}} can select: \cr brodimoprim (BDP), sulfadiazine (SDI), sulfadiazine/tetroxoprim (SLT), sulfadiazine/trimethoprim (SLT1), sulfadimethoxine (SUD), sulfadimidine (SDM), sulfadimidine/trimethoprim (SLT2), sulfafurazole (SLF), sulfaisodimidine (SLF1), sulfalene (SLF2), sulfamazone (SZO), sulfamerazine (SLF3), sulfamerazine/trimethoprim (SLT3), sulfamethizole (SLF4), sulfamethoxazole (SMX), sulfamethoxypyridazine (SLF5), sulfametomidine (SLF6), sulfametoxydiazine (SLF7), sulfametrole/trimethoprim (SLT4), sulfamoxole (SLF8), sulfamoxole/trimethoprim (SLT5), sulfanilamide (SLF9), sulfaperin (SLF10), sulfaphenazole (SLF11), sulfapyridine (SLF12), sulfathiazole (SUT), sulfathiourea (SLF13), trimethoprim (TMP), and trimethoprim/sulfamethoxazole (SXT)
\item \code{\link[=ureidopenicillins]{ureidopenicillins()}} can select: \cr azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), and piperacillin/tazobactam (TZP)
2021-06-04 21:07:55 +02:00
}
2020-06-17 01:39:30 +02:00
}
2021-06-04 21:07:55 +02:00
2021-01-18 16:57:56 +01:00
\section{Reference Data Publicly Available}{
2020-08-26 16:13:40 +02:00
2023-01-21 23:47:20 +01:00
All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, SAS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}.
2020-08-26 16:13:40 +02:00
}
2020-06-17 01:39:30 +02:00
\examples{
2021-01-24 14:48:56 +01:00
# `example_isolates` is a data set available in the AMR package.
2020-12-27 20:32:40 +01:00
# See ?example_isolates.
2022-08-27 20:49:37 +02:00
example_isolates
2020-12-27 20:32:40 +01:00
2023-03-11 16:54:02 +01:00
# Examples sections below are split into 'base R', 'dplyr', and 'data.table':
2021-06-04 21:07:55 +02:00
# base R ------------------------------------------------------------------
2021-05-19 22:55:42 +02:00
# select columns 'IPM' (imipenem) and 'MEM' (meropenem)
2022-08-27 20:49:37 +02:00
example_isolates[, carbapenems()]
2021-05-19 22:55:42 +02:00
# select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB'
2022-08-27 20:49:37 +02:00
example_isolates[, c("mo", aminoglycosides())]
2020-12-27 20:32:40 +01:00
2021-08-16 21:54:34 +02:00
# select only antibiotic columns with DDDs for oral treatment
2022-08-27 20:49:37 +02:00
example_isolates[, administrable_per_os()]
2021-08-16 21:54:34 +02:00
2021-05-19 22:55:42 +02:00
# filter using any() or all()
2022-08-27 20:49:37 +02:00
example_isolates[any(carbapenems() == "R"), ]
subset(example_isolates, any(carbapenems() == "R"))
2021-05-19 22:55:42 +02:00
# filter on any or all results in the carbapenem columns (i.e., IPM, MEM):
2022-08-27 20:49:37 +02:00
example_isolates[any(carbapenems()), ]
example_isolates[all(carbapenems()), ]
2021-05-19 22:55:42 +02:00
# filter with multiple antibiotic selectors using c()
2022-08-27 20:49:37 +02:00
example_isolates[all(c(carbapenems(), aminoglycosides()) == "R"), ]
2021-05-19 22:55:42 +02:00
2023-03-11 16:54:02 +01:00
# filter + select in one go: get penicillins in carbapenem-resistant strains
2022-08-27 20:49:37 +02:00
example_isolates[any(carbapenems() == "R"), penicillins()]
2021-05-19 22:55:42 +02:00
2021-08-16 21:54:34 +02:00
# You can combine selectors with '&' to be more specific. For example,
# penicillins() would select benzylpenicillin ('peni G') and
# administrable_per_os() would select erythromycin. Yet, when combined these
# drugs are both omitted since benzylpenicillin is not administrable per os
# and erythromycin is not a penicillin:
2022-08-27 20:49:37 +02:00
example_isolates[, penicillins() & administrable_per_os()]
2021-08-16 21:54:34 +02:00
2023-03-11 16:54:02 +01:00
# ab_selector() applies a filter in the `antibiotics` data set and is thus
# very flexible. For instance, to select antibiotic columns with an oral DDD
# of at least 1 gram:
2022-08-27 20:49:37 +02:00
example_isolates[, ab_selector(oral_ddd > 1 & oral_units == "g")]
2021-05-19 22:55:42 +02:00
2021-05-24 09:00:11 +02:00
\donttest{
2023-03-11 16:54:02 +01:00
# dplyr -------------------------------------------------------------------
if (require("dplyr")) {
tibble(kefzol = random_sir(5)) \%>\%
select(cephalosporins())
}
2020-09-29 23:35:46 +02:00
if (require("dplyr")) {
2022-08-27 20:49:37 +02:00
# get AMR for all aminoglycosides e.g., per ward:
example_isolates \%>\%
2022-08-28 10:31:50 +02:00
group_by(ward) \%>\%
2021-06-03 15:19:21 +02:00
summarise(across(aminoglycosides(), resistance))
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2021-08-16 21:54:34 +02:00
# You can combine selectors with '&' to be more specific:
2022-08-27 20:49:37 +02:00
example_isolates \%>\%
2021-08-16 21:54:34 +02:00
select(penicillins() & administrable_per_os())
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2021-12-09 10:48:25 +01:00
# get AMR for only drugs that matter - no intrinsic resistance:
2022-08-27 20:49:37 +02:00
example_isolates \%>\%
2022-08-28 10:31:50 +02:00
filter(mo_genus() \%in\% c("Escherichia", "Klebsiella")) \%>\%
group_by(ward) \%>\%
2021-12-09 10:48:25 +01:00
summarise(across(not_intrinsic_resistant(), resistance))
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2021-08-16 21:54:34 +02:00
# get susceptibility for antibiotics whose name contains "trim":
2022-08-27 20:49:37 +02:00
example_isolates \%>\%
2022-08-28 10:31:50 +02:00
filter(first_isolate()) \%>\%
group_by(ward) \%>\%
2021-08-16 21:54:34 +02:00
summarise(across(ab_selector(name \%like\% "trim"), susceptibility))
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2020-06-17 01:39:30 +02:00
# this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
2022-08-28 10:31:50 +02:00
example_isolates \%>\%
2020-06-17 01:39:30 +02:00
select(carbapenems())
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2020-06-17 01:39:30 +02:00
# this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':
2022-08-28 10:31:50 +02:00
example_isolates \%>\%
2020-06-17 01:39:30 +02:00
select(mo, aminoglycosides())
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2022-08-28 10:31:50 +02:00
# any() and all() work in dplyr's filter() too:
example_isolates \%>\%
filter(
any(aminoglycosides() == "R"),
all(cephalosporins_2nd() == "R")
)
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2022-08-28 10:31:50 +02:00
# also works with c():
example_isolates \%>\%
2021-05-19 22:55:42 +02:00
filter(any(c(carbapenems(), aminoglycosides()) == "R"))
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2022-08-28 10:31:50 +02:00
# not setting any/all will automatically apply all():
example_isolates \%>\%
2021-05-19 22:55:42 +02:00
filter(aminoglycosides() == "R")
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2020-06-17 15:14:37 +02:00
# this will select columns 'mo' and all antimycobacterial drugs ('RIF'):
2022-08-28 10:31:50 +02:00
example_isolates \%>\%
2020-06-17 15:14:37 +02:00
select(mo, ab_class("mycobact"))
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2022-08-21 16:37:20 +02:00
# get bug/drug combinations for only glycopeptides in Gram-positives:
2022-08-28 10:31:50 +02:00
example_isolates \%>\%
filter(mo_is_gram_positive()) \%>\%
select(mo, glycopeptides()) \%>\%
2020-06-17 15:14:37 +02:00
bug_drug_combinations() \%>\%
format()
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2022-08-28 10:31:50 +02:00
data.frame(
some_column = "some_value",
J01CA01 = "S"
) \%>\% # ATC code of ampicillin
select(penicillins()) # only the 'J01CA01' column will be selected
2022-08-27 20:49:37 +02:00
}
if (require("dplyr")) {
2023-03-12 13:02:37 +01:00
# with recent versions of dplyr, this is all equal:
2022-08-27 20:49:37 +02:00
x <- example_isolates[carbapenems() == "R", ]
y <- example_isolates \%>\% filter(carbapenems() == "R")
2022-08-28 10:31:50 +02:00
z <- example_isolates \%>\% filter(if_all(carbapenems(), ~ .x == "R"))
2022-08-27 20:49:37 +02:00
identical(x, y) && identical(y, z)
2020-06-17 01:39:30 +02:00
}
2023-03-11 16:54:02 +01:00
# data.table --------------------------------------------------------------
# data.table is supported as well, just use it in the same way as with
2023-03-12 13:02:37 +01:00
# base R, but add `with = FALSE` if using a single AB selector.
2023-03-11 16:54:02 +01:00
if (require("data.table")) {
dt <- as.data.table(example_isolates)
2023-03-12 13:02:37 +01:00
# this does not work, it returns column *names*
dt[, carbapenems()]
}
if (require("data.table")) {
# so `with = FALSE` is required
dt[, carbapenems(), with = FALSE]
}
# for multiple selections or AB selectors, `with = FALSE` is not needed:
if (require("data.table")) {
dt[, c("mo", aminoglycosides())]
}
if (require("data.table")) {
dt[, c(carbapenems(), aminoglycosides())]
}
# row filters are also supported:
if (require("data.table")) {
dt[any(carbapenems() == "S"), ]
}
if (require("data.table")) {
dt[any(carbapenems() == "S"), penicillins(), with = FALSE]
2023-03-11 16:54:02 +01:00
}
2020-06-17 01:39:30 +02:00
}
2021-05-24 09:00:11 +02:00
}