* Function `freq()` has moved to a new package, [`clean`](https://github.com/msberends/clean) ([CRAN link](https://cran.r-project.org/package=clean)). Creating frequency tables is actually not the scope of this package (never was) and this function has matured a lot over the last two years. Therefore, a new package was created for data cleaning and checking and it perfectly fits the `freq()` function. The [`clean`](https://github.com/msberends/clean) package is available on CRAN and will be installed automatically when updating the `AMR` package, that now imports it. In a later stage, the `skewness()` and `kurtosis()` functions will be moved to the `clean` package too.
<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 July 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 06 August 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="cb15-25"data-line-number="25"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,312 new changes)</span></a>
<aclass="sourceLine"id="cb15-25"data-line-number="25"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,329 new changes)</span></a>
<aclass="sourceLine"id="cb15-26"data-line-number="26"><spanclass="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no new changes)</span></a>
<aclass="sourceLine"id="cb15-27"data-line-number="27"><spanclass="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no new changes)</span></a>
<aclass="sourceLine"id="cb15-28"data-line-number="28"><spanclass="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,746 new changes)</span></a>
<aclass="sourceLine"id="cb15-28"data-line-number="28"><spanclass="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,679 new changes)</span></a>
<aclass="sourceLine"id="cb15-29"data-line-number="29"><spanclass="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no new changes)</span></a>
<aclass="sourceLine"id="cb15-30"data-line-number="30"><spanclass="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no new changes)</span></a>
<aclass="sourceLine"id="cb15-31"data-line-number="31"><spanclass="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no new changes)</span></a>
@ -452,24 +452,24 @@
<aclass="sourceLine"id="cb15-33"data-line-number="33"><spanclass="co"># Table 13: Interpretive rules for quinolones (no new changes)</span></a>
<aclass="sourceLine"id="cb15-35"data-line-number="35"><spanclass="co"># Other rules</span></a>
<aclass="sourceLine"id="cb15-36"data-line-number="36"><spanclass="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,284 new changes)</span></a>
<aclass="sourceLine"id="cb15-37"data-line-number="37"><spanclass="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (116 new changes)</span></a>
<aclass="sourceLine"id="cb15-36"data-line-number="36"><spanclass="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,347 new changes)</span></a>
<aclass="sourceLine"id="cb15-37"data-line-number="37"><spanclass="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (114 new changes)</span></a>
<aclass="sourceLine"id="cb15-38"data-line-number="38"><spanclass="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no new changes)</span></a>
<aclass="sourceLine"id="cb15-39"data-line-number="39"><spanclass="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no new changes)</span></a>
<aclass="sourceLine"id="cb15-40"data-line-number="40"><spanclass="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no new changes)</span></a>
<aclass="sourceLine"id="cb15-41"data-line-number="41"><spanclass="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no new changes)</span></a>
<aclass="sourceLine"id="cb15-44"data-line-number="44"><spanclass="co"># EUCAST rules affected 6,581 out of 20,000 rows, making a total of 7,943 edits</span></a>
<aclass="sourceLine"id="cb15-44"data-line-number="44"><spanclass="co"># EUCAST rules affected 6,589 out of 20,000 rows, making a total of 7,908 edits</span></a>
<aclass="sourceLine"id="cb15-45"data-line-number="45"><spanclass="co"># => added 0 test results</span></a>
<aclass="sourceLine"id="cb15-56"data-line-number="56"><spanclass="co"># Use verbose = TRUE (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -497,8 +497,8 @@
<aclass="sourceLine"id="cb17-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="cb17-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="cb17-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="cb17-6"data-line-number="6"><spanclass="co"># => Found 5,701 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="cb17-6"data-line-number="6"><spanclass="co"># => Found 5,681 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 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 S2, 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 C10, sorted on date:</p>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -524,8 +524,8 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-03-05</td>
<tdalign="center">S2</td>
<tdalign="center">2010-07-24</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -535,10 +535,10 @@
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-03-09</td>
<tdalign="center">S2</td>
<tdalign="center">2010-12-03</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -546,21 +546,21 @@
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-08-25</td>
<tdalign="center">S2</td>
<tdalign="center">2010-12-19</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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-09-20</td>
<tdalign="center">S2</td>
<tdalign="center">2011-02-18</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -568,19 +568,19 @@
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-10-11</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-26</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-02-11</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-28</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -590,43 +590,43 @@
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-02-24</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-30</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</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">8</td>
<tdalign="center">2011-03-12</td>
<tdalign="center">S2</td>
<tdalign="center">2011-08-29</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-04-21</td>
<tdalign="center">S2</td>
<tdalign="center">2011-10-03</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-05-04</td>
<tdalign="center">S2</td>
<tdalign="center">2011-12-30</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -645,7 +645,7 @@
<aclass="sourceLine"id="cb20-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="cb20-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="cb20-9"data-line-number="9"><spanclass="co"># [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<aclass="sourceLine"id="cb20-10"data-line-number="10"><spanclass="co"># => Found 15,136 first weighted isolates (75.7% of total)</span></a></code></pre></div>
<aclass="sourceLine"id="cb20-10"data-line-number="10"><spanclass="co"># => Found 15,027 first weighted isolates (75.1% of total)</span></a></code></pre></div>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -662,8 +662,8 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-03-05</td>
<tdalign="center">S2</td>
<tdalign="center">2010-07-24</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -674,34 +674,34 @@
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-03-09</td>
<tdalign="center">S2</td>
<tdalign="center">2010-12-03</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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="odd">
<tdalign="center">3</td>
<tdalign="center">2010-08-25</td>
<tdalign="center">S2</td>
<tdalign="center">2010-12-19</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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-09-20</td>
<tdalign="center">S2</td>
<tdalign="center">2011-02-18</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -710,20 +710,20 @@
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2010-10-11</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-26</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-02-11</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-28</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -734,46 +734,46 @@
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-02-24</td>
<tdalign="center">S2</td>
<tdalign="center">B_ESCHR_COL</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>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-03-12</td>
<tdalign="center">S2</td>
<tdalign="center">2011-06-30</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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">8</td>
<tdalign="center">2011-08-29</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-04-21</td>
<tdalign="center">S2</td>
<tdalign="center">2011-10-03</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</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">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-05-04</td>
<tdalign="center">S2</td>
<tdalign="center">2011-12-30</td>
<tdalign="center">C10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -782,11 +782,11 @@
</tr>
</tbody>
</table>
<p>Instead of 2, now 7 isolates are flagged. In total, 75.7% of all isolates are marked ‘first weighted’ - 47.2% 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, of all isolates are marked ‘first weighted’ - 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/portion.html">portion_S()</a></code>, <code><ahref="../reference/portion.html">portion_SI()</a></code>, <code><ahref="../reference/portion.html">portion_I()</a></code>, <code><ahref="../reference/portion.html">portion_IR()</a></code> and <code><ahref="../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><ahref="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><ahref="../reference/portion.html">portion_SI()</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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.