This is an example R Markdown file to show the use of antibiogram() of the AMR package.

For starters, this is what our example_isolates data set looks like:

example_isolates
## # A tibble: 2,000 × 46
##    date       patient   age gender ward     mo           PEN   OXA   FLC   AMX  
##    <date>     <chr>   <dbl> <chr>  <chr>    <mo>         <sir> <sir> <sir> <sir>
##  1 2002-01-02 A77334     65 F      Clinical B_ESCHR_COLI R     NA    NA    NA   
##  2 2002-01-03 A77334     65 F      Clinical B_ESCHR_COLI R     NA    NA    NA   
##  3 2002-01-07 067927     45 F      ICU      B_STPHY_EPDR R     NA    R     NA   
##  4 2002-01-07 067927     45 F      ICU      B_STPHY_EPDR R     NA    R     NA   
##  5 2002-01-13 067927     45 F      ICU      B_STPHY_EPDR R     NA    R     NA   
##  6 2002-01-13 067927     45 F      ICU      B_STPHY_EPDR R     NA    R     NA   
##  7 2002-01-14 462729     78 M      Clinical B_STPHY_AURS R     NA    S     R    
##  8 2002-01-14 462729     78 M      Clinical B_STPHY_AURS R     NA    S     R    
##  9 2002-01-16 067927     45 F      ICU      B_STPHY_EPDR R     NA    R     NA   
## 10 2002-01-17 858515     79 F      ICU      B_STPHY_EPDR R     NA    S     NA   
## # … with 1,990 more rows, and 36 more variables: AMC <sir>, AMP <sir>,
## #   TZP <sir>, CZO <sir>, FEP <sir>, CXM <sir>, FOX <sir>, CTX <sir>,
## #   CAZ <sir>, CRO <sir>, GEN <sir>, TOB <sir>, AMK <sir>, KAN <sir>,
## #   TMP <sir>, SXT <sir>, NIT <sir>, FOS <sir>, LNZ <sir>, CIP <sir>,
## #   MFX <sir>, VAN <sir>, TEC <sir>, TCY <sir>, TGC <sir>, DOX <sir>,
## #   ERY <sir>, CLI <sir>, AZM <sir>, IPM <sir>, MEM <sir>, MTR <sir>,
## #   CHL <sir>, COL <sir>, MUP <sir>, RIF <sir>

Traditional Antibiogram

antibiogram(example_isolates,
            antibiotics = c(aminoglycosides(), carbapenems()))
Pathogen (N min-max) AMK GEN IPM KAN MEM TOB
CoNS (43-309) 0 86 52 0 52 22
E. coli (0-462) 100 98 100 100 97
E. faecalis (0-39) 0 0 100 0 0
K. pneumoniae (0-58) 90 100 100 90
P. aeruginosa (17-30) 100 0 100
P. mirabilis (0-34) 94 94 94
S. aureus (2-233) 99 98
S. epidermidis (8-163) 0 79 0 51
S. hominis (3-80) 92 85
S. pneumoniae (11-117) 0 0 0 0

Combined Antibiogram

antibiogram(example_isolates,
            antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"))
Pathogen (N min-max) TZP TZP + GEN TZP + TOB
CoNS (29-274) 30 97
E. coli (416-461) 94 100 99
K. pneumoniae (53-58) 89 93 93
P. aeruginosa (27-30) 100 100
P. mirabilis (27-34) 100 100
S. aureus (7-231) 100 100
S. epidermidis (5-128) 100 100
S. hominis (0-74) 100 100
S. pneumoniae (112-112) 100 100 100

Syndromic Antibiogram

antibiogram(example_isolates,
             antibiotics = c(aminoglycosides(), carbapenems()),
             syndromic_group = "ward")
Syndromic Group Pathogen (N min-max) AMK GEN IPM KAN MEM TOB
Clinical CoNS (23-205) 89 57 57 26
ICU CoNS (10-73) 79
Outpatient CoNS (3-31) 84
Clinical E. coli (0-299) 100 98 100 100 98
ICU E. coli (0-137) 100 99 100 100 96
Clinical K. pneumoniae (0-51) 92 100 100 92
Clinical P. mirabilis (0-30) 100 100
Clinical S. aureus (2-150) 99 97
ICU S. aureus (0-66) 100
Clinical S. epidermidis (4-79) 82 55
ICU S. epidermidis (4-75) 72 41
Clinical S. hominis (1-45) 96 94
Clinical S. pneumoniae (5-78) 0 0 0 0
ICU S. pneumoniae (5-30) 0 0 0 0

Weighted-Incidence Syndromic Combination Antibiogram (WISCA)

antibiogram(example_isolates,
            antibiotics = c("AMC", "AMC+CIP", "TZP", "TZP+TOB"),
            mo_transform = "gramstain",
            minimum = 10, # this should be >= 30, but now just as example
            syndromic_group = ifelse(example_isolates$age >= 65 &
                                       example_isolates$gender == "M",
                                     "WISCA Group 1", "WISCA Group 2"))
Syndromic Group Pathogen (N min-max) AMC AMC + CIP TZP TZP + TOB
WISCA Group 1 Gram-negative (261-285) 76 95 89 99
WISCA Group 2 Gram-negative (380-442) 76 98 88 98
WISCA Group 1 Gram-positive (123-406) 76 89 81 95
WISCA Group 2 Gram-positive (222-732) 76 89 88 95