* 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.
#' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates.
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed.
#' @inheritParams proportion
#' @inheritSection as.rsi Interpretation of S, I and R
#' @inheritSection as.rsi Interpretation of R and S/I
#' @details These functions are meant to count isolates. Use the [resistance()]/[susceptibility()] functions to calculate microbial resistance/susceptibility.
#'
#' The function [count_resistant()] is equal to the function [count_R()]. The function [count_susceptible()] is equal to the function [count_SI()].
#' Convenient wrapper around [base::grep()] to match a pattern: `a %like% b`. It always returns a [`logical`] vector and is always case-insensitive (use `a %like_case% b` for case-sensitive matching). Also, `pattern` (*b*) can be as long as `x` (*a*) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.
#' @inheritParams base::grepl
#' @param x a character vector where matches are sought, or an object which can be coerced by [as.character()] to a character vector.
#' @param pattern a character string containing a regular expression (or [`character`] string for `fixed = TRUE`) to be matched in the given character vector. Coerced by [as.character()] to a character string if possible. If a [`character`] vector of length 2 or more is supplied, the first element is used with a warning.
#' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching.
#' Please suggest your own (country-specific) guidelines by letting us know: <https://gitlab.com/msberends/AMR/issues/new>.
#'
#' **Note:** Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu *et al.* in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this [mdro()] function makes sure that results from before 2016 and after 2016 are identical.
#' @inheritSection as.rsi Interpretation of S, I and R
#' @inheritSection as.rsi Interpretation of R and S/I
#' @return
#' - CMI 2012 paper - function [mdr_cmi2012()] or [mdro()]:\cr
#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter `combine_IR`, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is `TRUE`.
#' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter `combine_SI`.
#' @inheritSection as.rsi Interpretation of S, I and R
#' @inheritSection as.rsi Interpretation of R and S/I
#' @details
#' The function [resistance()] is equal to the function [proportion_R()]. The function [susceptibility()] is equal to the function [proportion_SI()].
#' Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Invalid antimicrobial interpretations will be translated as `NA` with a warning.
#' Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Invalid antimicrobial interpretations will be translated as `NA` with a warning.
#' @rdname as.rsi
#' @param x vector of values (for class [`mic`]: an MIC value in mg/L, for class [`disk`]: a disk diffusion radius in millimeters)
#' @param mo a microorganism code, generated with [as.mo()]
@ -35,14 +35,15 @@
#' After using [as.rsi()], you can use [eucast_rules()] to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
#'
#' The function [is.rsi.eligible()] returns `TRUE` when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and `FALSE` otherwise. The threshold of 5% can be set with the `threshold` parameter.
#' @section Interpretation of S, I and R:
#' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<http://www.eucast.org/newsiandr/>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
#' @section Interpretation of R and S/I:
#' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories R and S/I as shown below (<http://www.eucast.org/newsiandr/>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
#'
#' - **S** - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
#' - **I** - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
#' - **R** - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
#'
#' Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
#' - **R = Resistant**\cr
#' A microorganism is categorised as *Resistant* when there is a high likelihood of therapeutic failure even when there is increased exposure. Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
#' - **S = Susceptible**\cr
#' A microorganism is categorised as *Susceptible, standard dosing regimen*, when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
#' - **I = Increased exposure, but still susceptible**\cr
#' A microorganism is categorised as *Susceptible, Increased exposure* when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
#'
#' This AMR package honours this new insight. Use [susceptibility()] (equal to [proportion_SI()]) to determine antimicrobial susceptibility and [count_susceptible()] (equal to [count_SI()]) to count susceptible isolates.
<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><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 29 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,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-6"data-line-number="6"><spanclass="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,987 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 (122 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,31 +448,31 @@
<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,309 values changed)</span></a>
<aclass="sourceLine"id="cb14-36"data-line-number="36"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,300 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>
<aclass="sourceLine"id="cb14-43"data-line-number="43"><spanclass="co"># Table 12: Interpretive rules for aminoglycosides (no changes)</span></a>
<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,464 out of 20,000 rows, making a total of 8,119 edits</span></a>
<aclass="sourceLine"id="cb14-47"data-line-number="47"><spanclass="co"># EUCAST rules affected 6,539 out of 20,000 rows, making a total of 8,195 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>
</div>
@ -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,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>
<aclass="sourceLine"id="cb16-6"data-line-number="6"><spanclass="co"># => Found 5,689 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 28.4% 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 T6, 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 N6, sorted on date:</p>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -526,19 +526,19 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-02-28</td>
<tdalign="center">T6</td>
<tdalign="center">2010-02-23</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-03-01</td>
<tdalign="center">T6</td>
<tdalign="center">2010-04-09</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -548,21 +548,21 @@
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-05-20</td>
<tdalign="center">T6</td>
<tdalign="center">2010-04-23</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-06-21</td>
<tdalign="center">T6</td>
<tdalign="center">2010-05-12</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
@ -570,10 +570,10 @@
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-09-24</td>
<tdalign="center">T6</td>
<tdalign="center">2010-06-27</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -581,52 +581,52 @@
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2010-11-18</td>
<tdalign="center">T6</td>
<tdalign="center">2010-08-09</td>
<tdalign="center">N6</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="odd">
<tdalign="center">7</td>
<tdalign="center">2011-02-07</td>
<tdalign="center">T6</td>
<tdalign="center">2010-09-01</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">I</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>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-03-09</td>
<tdalign="center">T6</td>
<tdalign="center">2010-10-18</td>
<tdalign="center">N6</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">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</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">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-01-18</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-04-01</td>
<tdalign="center">T6</td>
<tdalign="center">2011-02-15</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -636,7 +636,7 @@
</tr>
</tbody>
</table>
<p>Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><ahref="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><ahref="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>If a column exists with a name like ‘key(…)ab’ the <code><ahref="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
<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,096 first weighted isolates (75.5% of total)</span></a></code></pre></div>
<aclass="sourceLine"id="cb19-10"data-line-number="10"><spanclass="co"># => Found 15,038 first weighted isolates (75.2% of total)</span></a></code></pre></div>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -664,20 +664,20 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-02-28</td>
<tdalign="center">T6</td>
<tdalign="center">2010-02-23</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-03-01</td>
<tdalign="center">T6</td>
<tdalign="center">2010-04-09</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -688,22 +688,22 @@
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-05-20</td>
<tdalign="center">T6</td>
<tdalign="center">2010-04-23</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-06-21</td>
<tdalign="center">T6</td>
<tdalign="center">2010-05-12</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
@ -712,10 +712,10 @@
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-09-24</td>
<tdalign="center">T6</td>
<tdalign="center">2010-06-27</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -724,56 +724,56 @@
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2010-11-18</td>
<tdalign="center">T6</td>
<tdalign="center">2010-08-09</td>
<tdalign="center">N6</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">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-02-07</td>
<tdalign="center">T6</td>
<tdalign="center">2010-09-01</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">I</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">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-03-09</td>
<tdalign="center">T6</td>
<tdalign="center">2010-10-18</td>
<tdalign="center">N6</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">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</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">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-01-18</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-04-01</td>
<tdalign="center">T6</td>
<tdalign="center">2011-02-15</td>
<tdalign="center">N6</td>
<tdalign="center">B_ESCHR_COLI</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -784,11 +784,11 @@
</tr>
</tbody>
</table>
<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>Instead of 1, now 9 isolates are flagged. In total, 75.2% of all isolates are marked ‘first weighted’ - 46.7% 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>