1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 05:26:13 +01:00

(v0.7.1.9104) vignette fix

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-10-12 09:15:27 +02:00
parent b2a08d056b
commit 2eb4a42f3d
17 changed files with 228 additions and 228 deletions

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 0.7.1.9103 Version: 0.7.1.9104
Date: 2019-10-11 Date: 2019-10-12
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(
person(role = c("aut", "cre"), person(role = c("aut", "cre"),

View File

@ -1,5 +1,5 @@
# AMR 0.7.1.9103 # AMR 0.7.1.9104
<small>Last updated: 11-Oct-2019</small> <small>Last updated: 12-Oct-2019</small>
### Breaking ### Breaking
* Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`: * Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`:

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a> <a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -41,7 +41,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9096</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>
@ -187,7 +187,7 @@
<h1>How to conduct AMR analysis</h1> <h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">07 October 2019</h4> <h4 class="date">12 October 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div> <div class="hidden name"><code>AMR.Rmd</code></div>
@ -196,7 +196,7 @@
<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 <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 07 October 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 <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 12 October 2019.</p>
<div id="introduction" class="section level1"> <div id="introduction" class="section level1">
<h1 class="hasAnchor"> <h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1> <a href="#introduction" class="anchor"></a>Introduction</h1>
@ -212,21 +212,21 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2019-10-07</td> <td align="center">2019-10-12</td>
<td align="center">abcd</td> <td align="center">abcd</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2019-10-07</td> <td align="center">2019-10-12</td>
<td align="center">abcd</td> <td align="center">abcd</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">2019-10-07</td> <td align="center">2019-10-12</td>
<td align="center">efgh</td> <td align="center">efgh</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">R</td> <td align="center">R</td>
@ -321,68 +321,68 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2012-10-04</td> <td align="center">2013-11-09</td>
<td align="center">J3</td> <td align="center">N10</td>
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td> <td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">M</td> <td align="center">S</td>
<td align="center">F</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2015-03-12</td> <td align="center">2015-04-24</td>
<td align="center">S8</td> <td align="center">S9</td>
<td align="center">Hospital A</td> <td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td> <td align="center">Staphylococcus aureus</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">I</td> <td align="center">R</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">2015-05-15</td> <td align="center">2010-09-03</td>
<td align="center">Q9</td> <td align="center">Y7</td>
<td align="center">Hospital A</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2012-10-15</td>
<td align="center">G6</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2012-04-15</td>
<td align="center">G8</td>
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">Staphylococcus aureus</td> <td align="center">Escherichia coli</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2012-01-10</td>
<td align="center">H4</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2015-10-06</td>
<td align="center">M7</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2015-03-26</td> <td align="center">2014-12-13</td>
<td align="center">M3</td> <td align="center">D6</td>
<td align="center">Hospital B</td> <td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td> <td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
</tr> </tr>
@ -407,8 +407,8 @@
# #
# Item Count Percent Cum. Count Cum. Percent # Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- ------------- # --- ----- ------- -------- ----------- -------------
# 1 M 10,403 52.02% 10,403 52.02% # 1 M 10,499 52.50% 10,499 52.50%
# 2 F 9,597 47.99% 20,000 100.00%</code></pre> # 2 F 9,501 47.51% 20,000 100.00%</code></pre>
<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 didnt already know.</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 didnt 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><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</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><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a> <div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -438,14 +438,14 @@
<a class="sourceLine" id="cb15-18" data-line-number="18"><span class="co"># Pasteurella multocida (no changes)</span></a> <a class="sourceLine" id="cb15-18" data-line-number="18"><span class="co"># Pasteurella multocida (no changes)</span></a>
<a class="sourceLine" id="cb15-19" data-line-number="19"><span class="co"># Staphylococcus (no changes)</span></a> <a class="sourceLine" id="cb15-19" data-line-number="19"><span class="co"># Staphylococcus (no changes)</span></a>
<a class="sourceLine" id="cb15-20" data-line-number="20"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a> <a class="sourceLine" id="cb15-20" data-line-number="20"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,466 values changed)</span></a> <a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,411 values changed)</span></a>
<a class="sourceLine" id="cb15-22" data-line-number="22"><span class="co"># Viridans group streptococci (no changes)</span></a> <a class="sourceLine" id="cb15-22" data-line-number="22"><span class="co"># Viridans group streptococci (no changes)</span></a>
<a class="sourceLine" id="cb15-23" data-line-number="23"><span class="co"># </span></a> <a class="sourceLine" id="cb15-23" data-line-number="23"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-24" data-line-number="24"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a> <a class="sourceLine" id="cb15-24" data-line-number="24"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,304 values changed)</span></a> <a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,351 values changed)</span></a>
<a class="sourceLine" id="cb15-26" data-line-number="26"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a> <a class="sourceLine" id="cb15-26" data-line-number="26"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb15-27" data-line-number="27"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a> <a class="sourceLine" id="cb15-27" data-line-number="27"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,787 values changed)</span></a> <a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,698 values changed)</span></a>
<a class="sourceLine" id="cb15-29" data-line-number="29"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a> <a class="sourceLine" id="cb15-29" data-line-number="29"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb15-30" data-line-number="30"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a> <a class="sourceLine" id="cb15-30" data-line-number="30"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb15-31" data-line-number="31"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a> <a class="sourceLine" id="cb15-31" data-line-number="31"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -453,24 +453,24 @@
<a class="sourceLine" id="cb15-33" data-line-number="33"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a> <a class="sourceLine" id="cb15-33" data-line-number="33"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<a class="sourceLine" id="cb15-34" data-line-number="34"><span class="co"># </span></a> <a class="sourceLine" id="cb15-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-35" data-line-number="35"><span class="co"># Other rules</span></a> <a class="sourceLine" id="cb15-35" data-line-number="35"><span class="co"># Other rules</span></a>
<a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,243 values changed)</span></a> <a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,150 values changed)</span></a>
<a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (114 values changed)</span></a> <a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (105 values changed)</span></a>
<a class="sourceLine" id="cb15-38" data-line-number="38"><span class="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a> <a class="sourceLine" id="cb15-38" data-line-number="38"><span class="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<a class="sourceLine" id="cb15-39" data-line-number="39"><span class="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a> <a class="sourceLine" id="cb15-39" data-line-number="39"><span class="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb15-40" data-line-number="40"><span class="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a> <a class="sourceLine" id="cb15-40" data-line-number="40"><span class="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
<a class="sourceLine" id="cb15-41" data-line-number="41"><span class="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a> <a class="sourceLine" id="cb15-41" data-line-number="41"><span class="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<a class="sourceLine" id="cb15-42" data-line-number="42"><span class="co"># </span></a> <a class="sourceLine" id="cb15-42" data-line-number="42"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-43" data-line-number="43"><span class="co"># --------------------------------------------------------------------------</span></a> <a class="sourceLine" id="cb15-43" data-line-number="43"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,571 out of 20,000 rows, making a total of 7,914 edits</span></a> <a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,413 out of 20,000 rows, making a total of 7,715 edits</span></a>
<a class="sourceLine" id="cb15-45" data-line-number="45"><span class="co"># =&gt; added 0 test results</span></a> <a class="sourceLine" id="cb15-45" data-line-number="45"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb15-46" data-line-number="46"><span class="co"># </span></a> <a class="sourceLine" id="cb15-46" data-line-number="46"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,914 test results</span></a> <a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,715 test results</span></a>
<a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># - 104 test results changed from S to I</span></a> <a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># - 108 test results changed from S to I</span></a>
<a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># - 4,762 test results changed from S to R</span></a> <a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># - 4,673 test results changed from S to R</span></a>
<a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># - 1,059 test results changed from I to S</span></a> <a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># - 1,037 test results changed from I to S</span></a>
<a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># - 331 test results changed from I to R</span></a> <a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># - 329 test results changed from I to R</span></a>
<a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># - 1,638 test results changed from R to S</span></a> <a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># - 1,546 test results changed from R to S</span></a>
<a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># - 20 test results changed from R to I</span></a> <a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># - 22 test results changed from R to I</span></a>
<a class="sourceLine" id="cb15-54" data-line-number="54"><span class="co"># --------------------------------------------------------------------------</span></a> <a class="sourceLine" id="cb15-54" data-line-number="54"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-55" data-line-number="55"><span class="co"># </span></a> <a class="sourceLine" id="cb15-55" data-line-number="55"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-56" data-line-number="56"><span class="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> <a class="sourceLine" id="cb15-56" data-line-number="56"><span class="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>
@ -498,8 +498,8 @@
<a class="sourceLine" id="cb17-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a> <a class="sourceLine" id="cb17-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb17-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a> <a class="sourceLine" id="cb17-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb17-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a> <a class="sourceLine" id="cb17-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,696 first isolates (28.5% of total)</span></a></code></pre></div> <a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,682 first isolates (28.4% 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><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p> <p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div> <a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p> <p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -509,7 +509,7 @@
<div id="first-weighted-isolates" class="section level2"> <div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2> <a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<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 E8, 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 A2, sorted on date:</p>
<table class="table"> <table class="table">
<thead><tr class="header"> <thead><tr class="header">
<th align="center">isolate</th> <th align="center">isolate</th>
@ -525,19 +525,19 @@
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">1</td> <td align="center">1</td>
<td align="center">2010-01-14</td> <td align="center">2010-02-02</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2</td> <td align="center">2</td>
<td align="center">2010-03-24</td> <td align="center">2010-02-28</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -547,8 +547,8 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">3</td> <td align="center">3</td>
<td align="center">2010-05-23</td> <td align="center">2010-03-02</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -558,10 +558,10 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">4</td> <td align="center">4</td>
<td align="center">2010-08-30</td> <td align="center">2010-03-08</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -569,8 +569,8 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">5</td> <td align="center">5</td>
<td align="center">2010-09-04</td> <td align="center">2010-05-16</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td> <td align="center">R</td>
@ -580,10 +580,10 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">6</td> <td align="center">6</td>
<td align="center">2010-09-14</td> <td align="center">2010-09-25</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -591,10 +591,10 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">7</td> <td align="center">7</td>
<td align="center">2010-10-02</td> <td align="center">2011-01-03</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
@ -602,32 +602,32 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">8</td> <td align="center">8</td>
<td align="center">2011-01-01</td> <td align="center">2011-01-21</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">9</td> <td align="center">9</td>
<td align="center">2011-02-10</td> <td align="center">2011-05-24</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">10</td> <td align="center">10</td>
<td align="center">2011-03-11</td> <td align="center">2011-06-13</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -645,8 +645,8 @@
<a class="sourceLine" id="cb20-6" data-line-number="6"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a> <a class="sourceLine" id="cb20-6" data-line-number="6"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb20-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a> <a class="sourceLine" id="cb20-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb20-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a> <a class="sourceLine" id="cb20-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb20-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a> <a class="sourceLine" id="cb20-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 15,087 first weighted isolates (75.4% of total)</span></a></code></pre></div> <a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 15,216 first weighted isolates (76.1% of total)</span></a></code></pre></div>
<table class="table"> <table class="table">
<thead><tr class="header"> <thead><tr class="header">
<th align="center">isolate</th> <th align="center">isolate</th>
@ -663,20 +663,20 @@
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">1</td> <td align="center">1</td>
<td align="center">2010-01-14</td> <td align="center">2010-02-02</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2</td> <td align="center">2</td>
<td align="center">2010-03-24</td> <td align="center">2010-02-28</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -687,8 +687,8 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">3</td> <td align="center">3</td>
<td align="center">2010-05-23</td> <td align="center">2010-03-02</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -699,20 +699,20 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">4</td> <td align="center">4</td>
<td align="center">2010-08-30</td> <td align="center">2010-03-08</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">FALSE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">5</td> <td align="center">5</td>
<td align="center">2010-09-04</td> <td align="center">2010-05-16</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td> <td align="center">R</td>
@ -723,10 +723,10 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">6</td> <td align="center">6</td>
<td align="center">2010-09-14</td> <td align="center">2010-09-25</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -735,10 +735,10 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">7</td> <td align="center">7</td>
<td align="center">2010-10-02</td> <td align="center">2011-01-03</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
@ -747,11 +747,11 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">8</td> <td align="center">8</td>
<td align="center">2011-01-01</td> <td align="center">2011-01-21</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
@ -759,35 +759,35 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">9</td> <td align="center">9</td>
<td align="center">2011-02-10</td> <td align="center">2011-05-24</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">10</td> <td align="center">10</td>
<td align="center">2011-03-11</td> <td align="center">2011-06-13</td>
<td align="center">E8</td> <td align="center">A2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">FALSE</td> <td align="center">TRUE</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>Instead of 2, now 7 isolates are flagged. In total, 75.4% of all isolates are marked first weighted - 47.0% 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 9 isolates are flagged. In total, 76.1% of all isolates are marked first weighted - 47.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><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p> <p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div> <a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 15,087 isolates for analysis.</p> <p>So we end up with 15,216 isolates for analysis.</p>
<p>We can remove unneeded columns:</p> <p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb22-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div> <a class="sourceLine" id="cb22-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
@ -813,15 +813,15 @@
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td>1</td> <td>1</td>
<td align="center">2012-10-04</td> <td align="center">2013-11-09</td>
<td align="center">J3</td> <td align="center">N10</td>
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td> <td align="center">B_STRPT_PNMN</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">M</td> <td align="center">F</td>
<td align="center">Gram-positive</td> <td align="center">Gram-positive</td>
<td align="center">Streptococcus</td> <td align="center">Streptococcus</td>
<td align="center">pneumoniae</td> <td align="center">pneumoniae</td>
@ -829,12 +829,12 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td>2</td> <td>2</td>
<td align="center">2015-03-12</td> <td align="center">2015-04-24</td>
<td align="center">S8</td> <td align="center">S9</td>
<td align="center">Hospital A</td> <td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td> <td align="center">B_STPHY_AURS</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">I</td> <td align="center">R</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
@ -845,60 +845,60 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td>3</td> <td>3</td>
<td align="center">2015-05-15</td> <td align="center">2010-09-03</td>
<td align="center">Q9</td> <td align="center">Y7</td>
<td align="center">Hospital A</td> <td align="center">Hospital C</td>
<td align="center">B_KLBSL_PNMN</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
<td align="center">Gram-negative</td> <td align="center">Gram-negative</td>
<td align="center">Klebsiella</td> <td align="center">Escherichia</td>
<td align="center">pneumoniae</td> <td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td>5</td> <td>4</td>
<td align="center">2012-04-15</td> <td align="center">2012-01-10</td>
<td align="center">G8</td> <td align="center">H4</td>
<td align="center">Hospital C</td> <td align="center">Hospital A</td>
<td align="center">B_STPHY_AURS</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
<td align="center">Gram-positive</td> <td align="center">Gram-negative</td>
<td align="center">Staphylococcus</td> <td align="center">Escherichia</td>
<td align="center">aureus</td> <td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td>6</td> <td>5</td>
<td align="center">2015-03-26</td> <td align="center">2015-10-06</td>
<td align="center">M3</td> <td align="center">M7</td>
<td align="center">Hospital B</td> <td align="center">Hospital C</td>
<td align="center">B_STPHY_AURS</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
<td align="center">Gram-positive</td> <td align="center">Gram-negative</td>
<td align="center">Staphylococcus</td> <td align="center">Escherichia</td>
<td align="center">aureus</td> <td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td>7</td> <td>7</td>
<td align="center">2011-08-08</td> <td align="center">2010-10-26</td>
<td align="center">V10</td> <td align="center">V9</td>
<td align="center">Hospital A</td> <td align="center">Hospital C</td>
<td align="center">B_STRPT_PNMN</td> <td align="center">B_STRPT_PNMN</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">F</td> <td align="center">F</td>
@ -926,7 +926,7 @@
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/clean/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div> <div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/clean/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p> <p><strong>Frequency table</strong></p>
<p>Class: character<br> <p>Class: character<br>
Length: 15,087 (of which NA: 0 = 0%)<br> Length: 15,216 (of which NA: 0 = 0%)<br>
Unique: 4</p> Unique: 4</p>
<p>Shortest: 16<br> <p>Shortest: 16<br>
Longest: 24</p> Longest: 24</p>
@ -943,33 +943,33 @@ Longest: 24</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">Escherichia coli</td> <td align="left">Escherichia coli</td>
<td align="right">7,412</td> <td align="right">7,521</td>
<td align="right">49.13%</td> <td align="right">49.43%</td>
<td align="right">7,412</td> <td align="right">7,521</td>
<td align="right">49.13%</td> <td align="right">49.43%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">Staphylococcus aureus</td> <td align="left">Staphylococcus aureus</td>
<td align="right">3,773</td> <td align="right">3,772</td>
<td align="right">25.01%</td> <td align="right">24.79%</td>
<td align="right">11,185</td> <td align="right">11,293</td>
<td align="right">74.14%</td> <td align="right">74.22%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td> <td align="left">Streptococcus pneumoniae</td>
<td align="right">2,331</td> <td align="right">2,273</td>
<td align="right">15.45%</td> <td align="right">14.94%</td>
<td align="right">13,516</td> <td align="right">13,566</td>
<td align="right">89.59%</td> <td align="right">89.16%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">4</td> <td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td> <td align="left">Klebsiella pneumoniae</td>
<td align="right">1,571</td> <td align="right">1,650</td>
<td align="right">10.41%</td> <td align="right">10.84%</td>
<td align="right">15,087</td> <td align="right">15,216</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>
</tbody> </tbody>
@ -980,7 +980,7 @@ Longest: 24</p>
<a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2> <a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2>
<p>The functions <code><a href="../reference/portion.html">portion_S()</a></code>, <code><a href="../reference/portion.html">portion_SI()</a></code>, <code><a href="../reference/portion.html">portion_I()</a></code>, <code><a href="../reference/portion.html">portion_IR()</a></code> and <code><a href="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (<code><a href="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><a href="../reference/portion.html">portion_SI()</a></code>). These functions can be used on their own:</p> <p>The functions <code><a href="../reference/portion.html">portion_S()</a></code>, <code><a href="../reference/portion.html">portion_SI()</a></code>, <code><a href="../reference/portion.html">portion_I()</a></code>, <code><a href="../reference/portion.html">portion_IR()</a></code> and <code><a href="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (<code><a href="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><a href="../reference/portion.html">portion_SI()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_R</a></span>(AMX)</a> <div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_R</a></span>(AMX)</a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4716643</span></a></code></pre></div> <a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4679942</span></a></code></pre></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p> <p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a> <a class="sourceLine" id="cb27-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -993,19 +993,19 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.4725537</td> <td align="center">0.4673913</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.4704871</td> <td align="center">0.4702744</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.4684529</td> <td align="center">0.4699524</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.4749061</td> <td align="center">0.4635025</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1023,23 +1023,23 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.4725537</td> <td align="center">0.4673913</td>
<td align="center">4609</td> <td align="center">4600</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.4704871</td> <td align="center">0.4702744</td>
<td align="center">5235</td> <td align="center">5248</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.4684529</td> <td align="center">0.4699524</td>
<td align="center">2314</td> <td align="center">2313</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.4749061</td> <td align="center">0.4635025</td>
<td align="center">2929</td> <td align="center">3055</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1059,27 +1059,27 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Escherichia</td> <td align="center">Escherichia</td>
<td align="center">0.9202644</td> <td align="center">0.9274033</td>
<td align="center">0.8950351</td> <td align="center">0.8917697</td>
<td align="center">0.9919050</td> <td align="center">0.9932190</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Klebsiella</td> <td align="center">Klebsiella</td>
<td align="center">0.8166773</td> <td align="center">0.8212121</td>
<td align="center">0.9019733</td> <td align="center">0.8909091</td>
<td align="center">0.9847231</td> <td align="center">0.9818182</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Staphylococcus</td> <td align="center">Staphylococcus</td>
<td align="center">0.9247283</td> <td align="center">0.9223224</td>
<td align="center">0.9196926</td> <td align="center">0.9141039</td>
<td align="center">0.9939041</td> <td align="center">0.9909862</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Streptococcus</td> <td align="center">Streptococcus</td>
<td align="center">0.6194766</td> <td align="center">0.6317642</td>
<td align="center">0.0000000</td> <td align="center">0.0000000</td>
<td align="center">0.6194766</td> <td align="center">0.6317642</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -43,7 +43,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>
@ -231,11 +231,11 @@
</div> </div>
<div id="amr-0-7-1-9103" class="section level1"> <div id="amr-0-7-1-9104" class="section level1">
<h1 class="page-header"> <h1 class="page-header">
<a href="#amr-0-7-1-9103" class="anchor"></a>AMR 0.7.1.9103<small> Unreleased </small> <a href="#amr-0-7-1-9104" class="anchor"></a>AMR 0.7.1.9104<small> Unreleased </small>
</h1> </h1>
<p><small>Last updated: 11-Oct-2019</small></p> <p><small>Last updated: 12-Oct-2019</small></p>
<div id="breaking" class="section level3"> <div id="breaking" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
<a href="#breaking" class="anchor"></a>Breaking</h3> <a href="#breaking" class="anchor"></a>Breaking</h3>
@ -1292,7 +1292,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav"> <div id="tocnav">
<h2>Contents</h2> <h2>Contents</h2>
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-7-1-9103">0.7.1.9103</a></li> <li><a href="#amr-0-7-1-9104">0.7.1.9104</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li> <li><a href="#amr-0-7-1">0.7.1</a></li>
<li><a href="#amr-0-7-0">0.7.0</a></li> <li><a href="#amr-0-7-0">0.7.0</a></li>
<li><a href="#amr-0-6-1">0.6.1</a></li> <li><a href="#amr-0-6-1">0.6.1</a></li>

View File

@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9102</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9102</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9103</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9104</span>
</span> </span>
</div> </div>

View File

@ -210,7 +210,7 @@ data <- data %>%
mutate(first = first_isolate(.)) mutate(first = first_isolate(.))
``` ```
So only `r clean:::percentage(sum(data$first) / nrow(data))` is suitable for resistance analysis! We can now filter on it with the `filter()` function, also from the `dplyr` package: So only `r percentage(sum(data$first) / nrow(data))` is suitable for resistance analysis! We can now filter on it with the `filter()` function, also from the `dplyr` package:
```{r 1st isolate filter} ```{r 1st isolate filter}
data_1st <- data %>% data_1st <- data %>%
@ -272,7 +272,7 @@ weighted_df2 %>%
knitr::kable(align = "c") knitr::kable(align = "c")
``` ```
Instead of `r sum(weighted_df$first)`, now `r sum(weighted_df2$first_weighted)` isolates are flagged. In total, `r clean:::percentage(sum(data$first_weighted) / nrow(data))` of all isolates are marked 'first weighted' - `r clean:::percentage((sum(data$first_weighted) / nrow(data)) - (sum(data$first) / nrow(data)))` more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline. Instead of `r sum(weighted_df$first)`, now `r sum(weighted_df2$first_weighted)` isolates are flagged. In total, `r percentage(sum(data$first_weighted) / nrow(data))` of all isolates are marked 'first weighted' - `r percentage((sum(data$first_weighted) / nrow(data)) - (sum(data$first) / nrow(data)))` more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
As with `filter_first_isolate()`, there's a shortcut for this new algorithm too: As with `filter_first_isolate()`, there's a shortcut for this new algorithm too:
```{r 1st isolate filter 3, results = 'hide', message = FALSE, warning = FALSE} ```{r 1st isolate filter 3, results = 'hide', message = FALSE, warning = FALSE}