* Adopted Adeolu *et al.* (2016), [PMID 27620848](https://www.ncbi.nlm.nih.gov/pubmed/27620848) for the `microorganisms` data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like *Morganellaceae* and *Yersiniaceae*). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with `mdro()` will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family.
#' A data set containing all antibiotics. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
#' @format A \code{\link{data.frame}} with 453 observations and 13 variables:
#' Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from the \code{antibiotics} data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
#' @format
#' \strong{For the \code{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:}
#' \describe{
#' \item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available}
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}}
#' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}
#'
#' Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
#' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}.
#'
#' Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 18 November 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 23 November 2019.</p>
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didnโt already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><ahref="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<aclass="sourceLine"id="cb14-3"data-line-number="3"><spanclass="co"># Other rules by this AMR package</span></a>
<aclass="sourceLine"id="cb14-4"data-line-number="4"><spanclass="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a>
<aclass="sourceLine"id="cb14-5"data-line-number="5"><spanclass="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a>
<aclass="sourceLine"id="cb14-6"data-line-number="6"><spanclass="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,986 values changed)</span></a>
<aclass="sourceLine"id="cb14-7"data-line-number="7"><spanclass="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (176 values changed)</span></a>
<aclass="sourceLine"id="cb14-6"data-line-number="6"><spanclass="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,952 values changed)</span></a>
<aclass="sourceLine"id="cb14-7"data-line-number="7"><spanclass="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (155 values changed)</span></a>
<aclass="sourceLine"id="cb14-8"data-line-number="8"><spanclass="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<aclass="sourceLine"id="cb14-9"data-line-number="9"><spanclass="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<aclass="sourceLine"id="cb14-10"data-line-number="10"><spanclass="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
@ -448,14 +448,14 @@
@@ -448,14 +448,14 @@
<aclass="sourceLine"id="cb14-29"data-line-number="29"><spanclass="co"># Pasteurella multocida (no changes)</span></a>
<aclass="sourceLine"id="cb14-30"data-line-number="30"><spanclass="co"># Staphylococcus (no changes)</span></a>
<aclass="sourceLine"id="cb14-31"data-line-number="31"><spanclass="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<aclass="sourceLine"id="cb14-36"data-line-number="36"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,284 values changed)</span></a>
<aclass="sourceLine"id="cb14-36"data-line-number="36"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,309 values changed)</span></a>
<aclass="sourceLine"id="cb14-37"data-line-number="37"><spanclass="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<aclass="sourceLine"id="cb14-38"data-line-number="38"><spanclass="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<aclass="sourceLine"id="cb14-40"data-line-number="40"><spanclass="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<aclass="sourceLine"id="cb14-41"data-line-number="41"><spanclass="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<aclass="sourceLine"id="cb14-42"data-line-number="42"><spanclass="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -463,15 +463,15 @@
@@ -463,15 +463,15 @@
<aclass="sourceLine"id="cb14-44"data-line-number="44"><spanclass="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<aclass="sourceLine"id="cb14-47"data-line-number="47"><spanclass="co"># EUCAST rules affected 6,569 out of 20,000 rows, making a total of 8,257 edits</span></a>
<aclass="sourceLine"id="cb14-47"data-line-number="47"><spanclass="co"># EUCAST rules affected 6,464 out of 20,000 rows, making a total of 8,119 edits</span></a>
<aclass="sourceLine"id="cb14-48"data-line-number="48"><spanclass="co"># => added 0 test results</span></a>
<aclass="sourceLine"id="cb14-58"data-line-number="58"><spanclass="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -499,8 +499,8 @@
@@ -499,8 +499,8 @@
<aclass="sourceLine"id="cb16-3"data-line-number="3"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb16-4"data-line-number="4"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `date` as input for `col_date`.</span></a>
<aclass="sourceLine"id="cb16-5"data-line-number="5"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb16-6"data-line-number="6"><spanclass="co"># => Found 5,699 first isolates (28.5% of total)</span></a></code></pre></div>
<p>So only 28.5% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<aclass="sourceLine"id="cb16-6"data-line-number="6"><spanclass="co"># => Found 5,669 first isolates (28.3% of total)</span></a></code></pre></div>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<p>For future use, the above two syntaxes can be shortened with the <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient X7, sorted on date:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient T6, sorted on date:</p>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -526,19 +526,19 @@
@@ -526,19 +526,19 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-03-18</td>
<tdalign="center">X7</td>
<tdalign="center">2010-02-28</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-04-28</td>
<tdalign="center">X7</td>
<tdalign="center">2010-03-01</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -548,32 +548,32 @@
@@ -548,32 +548,32 @@
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-06-26</td>
<tdalign="center">X7</td>
<tdalign="center">2010-05-20</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-08-06</td>
<tdalign="center">X7</td>
<tdalign="center">2010-06-21</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-08-31</td>
<tdalign="center">X7</td>
<tdalign="center">2010-09-24</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -581,19 +581,19 @@
@@ -581,19 +581,19 @@
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2010-10-15</td>
<tdalign="center">X7</td>
<tdalign="center">2010-11-18</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2010-11-19</td>
<tdalign="center">X7</td>
<tdalign="center">2011-02-07</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
@ -603,30 +603,30 @@
@@ -603,30 +603,30 @@
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-01-20</td>
<tdalign="center">X7</td>
<tdalign="center">2011-03-09</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-04-10</td>
<tdalign="center">X7</td>
<tdalign="center">2011-03-23</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-04-12</td>
<tdalign="center">X7</td>
<tdalign="center">2011-04-01</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -647,7 +647,7 @@
@@ -647,7 +647,7 @@
<aclass="sourceLine"id="cb19-7"data-line-number="7"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb19-8"data-line-number="8"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<aclass="sourceLine"id="cb19-9"data-line-number="9"><spanclass="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<aclass="sourceLine"id="cb19-10"data-line-number="10"><spanclass="co"># => Found 15,085 first weighted isolates (75.4% of total)</span></a></code></pre></div>
<aclass="sourceLine"id="cb19-10"data-line-number="10"><spanclass="co"># => Found 15,096 first weighted isolates (75.5% of total)</span></a></code></pre></div>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -664,131 +664,131 @@
@@ -664,131 +664,131 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-03-18</td>
<tdalign="center">X7</td>
<tdalign="center">2010-02-28</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-04-28</td>
<tdalign="center">X7</td>
<tdalign="center">2010-03-01</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-06-26</td>
<tdalign="center">X7</td>
<tdalign="center">2010-05-20</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-08-06</td>
<tdalign="center">X7</td>
<tdalign="center">2010-06-21</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-08-31</td>
<tdalign="center">X7</td>
<tdalign="center">2010-09-24</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2010-10-15</td>
<tdalign="center">X7</td>
<tdalign="center">2010-11-18</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2010-11-19</td>
<tdalign="center">X7</td>
<tdalign="center">2011-02-07</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-01-20</td>
<tdalign="center">X7</td>
<tdalign="center">2011-03-09</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-04-10</td>
<tdalign="center">X7</td>
<tdalign="center">2011-03-23</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-04-12</td>
<tdalign="center">X7</td>
<tdalign="center">2011-04-01</td>
<tdalign="center">T6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 6 isolates are flagged. In total, 75.4% of all isolates are marked โfirst weightedโ - 46.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 2, now 10 isolates are flagged. In total, 75.5% of all isolates are marked โfirst weightedโ - 47.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code>, thereโs a shortcut for this new algorithm too:</p>
<p>The functions <code><ahref="../reference/proportion.html">resistance()</a></code> and <code><ahref="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><ahref="../reference/proportion.html">proportion_S()</a></code>, <code><ahref="../reference/proportion.html">proportion_SI()</a></code>, <code><ahref="../reference/proportion.html">proportion_I()</a></code>, <code><ahref="../reference/proportion.html">proportion_IR()</a></code> and <code><ahref="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><ahref="../reference/proportion.html">proportion_R()</a></code>, equal to <code><ahref="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><ahref="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><ahref="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<p>Or can be used in conjuction with <code><ahref="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><ahref="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>