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

website update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-02-20 14:18:11 +01:00
parent 13120f465f
commit c6e57ca456
32 changed files with 259 additions and 259 deletions

View File

@ -327,21 +327,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2014-07-28</td>
<td align="center">F8</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">2010-03-15</td>
<td align="center">U2</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-04-01</td>
<td align="center">Y10</td>
<td align="center">2010-08-09</td>
<td align="center">Q7</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
@ -349,47 +349,47 @@
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2015-04-18</td>
<td align="center">J2</td>
<td align="center">2012-03-04</td>
<td align="center">P2</td>
<td align="center">Hospital B</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-08-08</td>
<td align="center">Y6</td>
<td align="center">2013-10-19</td>
<td align="center">K5</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">Staphylococcus aureus</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="odd">
<td align="center">2010-12-27</td>
<td align="center">B3</td>
<td align="center">Hospital B</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2016-12-01</td>
<td align="center">D4</td>
<tr class="odd">
<td align="center">2017-10-05</td>
<td align="center">I7</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</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">M</td>
</tr>
<tr class="even">
<td align="center">2017-09-27</td>
<td align="center">H7</td>
<td align="center">Hospital C</td>
<td align="center">Staphylococcus aureus</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>
</tr>
</tbody>
@ -411,8 +411,8 @@
#&gt;
#&gt; Item Count Percent Cum. Count Cum. Percent
#&gt; --- ----- ------- -------- ----------- -------------
#&gt; 1 M 10,333 51.7% 10,333 51.7%
#&gt; 2 F 9,667 48.3% 20,000 100.0%</code></pre>
#&gt; 1 M 10,384 51.9% 10,384 51.9%
#&gt; 2 F 9,616 48.1% 20,000 100.0%</code></pre>
<p>So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researcher 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>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -443,10 +443,10 @@
<a class="sourceLine" id="cb14-19" title="19"><span class="co">#&gt; Kingella kingae (no changes)</span></a>
<a class="sourceLine" id="cb14-20" title="20"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb14-21" title="21"><span class="co">#&gt; EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb14-22" title="22"><span class="co">#&gt; Table 1: Intrinsic resistance in Enterobacteriaceae (1307 changes)</span></a>
<a class="sourceLine" id="cb14-22" title="22"><span class="co">#&gt; Table 1: Intrinsic resistance in Enterobacteriaceae (1261 changes)</span></a>
<a class="sourceLine" id="cb14-23" title="23"><span class="co">#&gt; Table 2: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-24" title="24"><span class="co">#&gt; Table 3: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-25" title="25"><span class="co">#&gt; Table 4: Intrinsic resistance in Gram-positive bacteria (2811 changes)</span></a>
<a class="sourceLine" id="cb14-25" title="25"><span class="co">#&gt; Table 4: Intrinsic resistance in Gram-positive bacteria (2655 changes)</span></a>
<a class="sourceLine" id="cb14-26" title="26"><span class="co">#&gt; Table 8: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb14-27" title="27"><span class="co">#&gt; Table 9: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb14-28" title="28"><span class="co">#&gt; Table 10: Interpretive rules for B-lactam agents and other Gram-negative bacteria (no changes)</span></a>
@ -462,9 +462,9 @@
<a class="sourceLine" id="cb14-38" title="38"><span class="co">#&gt; Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb14-39" title="39"><span class="co">#&gt; Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<a class="sourceLine" id="cb14-40" title="40"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb14-41" title="41"><span class="co">#&gt; =&gt; EUCAST rules affected 7,381 out of 20,000 rows</span></a>
<a class="sourceLine" id="cb14-41" title="41"><span class="co">#&gt; =&gt; EUCAST rules affected 7,230 out of 20,000 rows</span></a>
<a class="sourceLine" id="cb14-42" title="42"><span class="co">#&gt; -&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb14-43" title="43"><span class="co">#&gt; -&gt; changed 4,118 test results (0 to S; 0 to I; 4,118 to R)</span></a></code></pre></div>
<a class="sourceLine" id="cb14-43" title="43"><span class="co">#&gt; -&gt; changed 3,916 test results (0 to S; 0 to I; 3,916 to R)</span></a></code></pre></div>
</div>
<div id="adding-new-variables" class="section level1">
<h1 class="hasAnchor">
@ -489,8 +489,8 @@
<a class="sourceLine" id="cb16-3" title="3"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb16-4" title="4"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb16-5" title="5"><span class="co">#&gt; </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="cb16-6" title="6"><span class="co">#&gt; =&gt; Found 5,690 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><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<a class="sourceLine" id="cb16-6" title="6"><span class="co">#&gt; =&gt; 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><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="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-2" title="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>
@ -516,8 +516,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-30</td>
<td align="center">J7</td>
<td align="center">2010-01-09</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -527,8 +527,8 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-01-30</td>
<td align="center">J7</td>
<td align="center">2010-04-24</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -538,76 +538,76 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-03-30</td>
<td align="center">J7</td>
<td align="center">2010-05-30</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-04-11</td>
<td align="center">J7</td>
<td align="center">2010-06-10</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-02</td>
<td align="center">J7</td>
<td align="center">2010-06-17</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-14</td>
<td align="center">J7</td>
<td align="center">2010-07-30</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-11-02</td>
<td align="center">J7</td>
<td align="center">2010-09-20</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-02-10</td>
<td align="center">J7</td>
<td align="center">2010-10-21</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-03-27</td>
<td align="center">J7</td>
<td align="center">2010-11-06</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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>
@ -615,14 +615,14 @@
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-21</td>
<td align="center">J7</td>
<td align="center">2011-05-21</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
@ -637,7 +637,7 @@
<a class="sourceLine" id="cb19-7" title="7"><span class="co">#&gt; </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="cb19-8" title="8"><span class="co">#&gt; </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="cb19-9" title="9"><span class="co">#&gt; [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<a class="sourceLine" id="cb19-10" title="10"><span class="co">#&gt; =&gt; Found 15,784 first weighted isolates (78.9% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb19-10" title="10"><span class="co">#&gt; =&gt; Found 15,871 first weighted isolates (79.4% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -654,8 +654,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-30</td>
<td align="center">J7</td>
<td align="center">2010-01-09</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -666,8 +666,8 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-01-30</td>
<td align="center">J7</td>
<td align="center">2010-04-24</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -678,11 +678,11 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-03-30</td>
<td align="center">J7</td>
<td align="center">2010-05-30</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
@ -690,23 +690,23 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-04-11</td>
<td align="center">J7</td>
<td align="center">2010-06-10</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-02</td>
<td align="center">J7</td>
<td align="center">2010-06-17</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
@ -714,46 +714,46 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-14</td>
<td align="center">J7</td>
<td align="center">2010-07-30</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-11-02</td>
<td align="center">J7</td>
<td align="center">2010-09-20</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-02-10</td>
<td align="center">J7</td>
<td align="center">2010-10-21</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-03-27</td>
<td align="center">J7</td>
<td align="center">2010-11-06</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</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>
@ -762,23 +762,23 @@
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-21</td>
<td align="center">J7</td>
<td align="center">2011-05-21</td>
<td align="center">V4</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 8 isolates are flagged. In total, 78.9% of all isolates are marked first weighted - 50.5% 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 6 isolates are flagged. In total, 79.4% of all isolates are marked first weighted - 50.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>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="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" title="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb20-2" title="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,784 isolates for analysis.</p>
<p>So we end up with 15,871 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" title="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" title="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://www.rdocumentation.org/packages/base/topics/c">c</a></span>(first, keyab))</a></code></pre></div>
@ -804,78 +804,78 @@
<tbody>
<tr class="odd">
<td>1</td>
<td align="center">2014-07-28</td>
<td align="center">F8</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COL</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">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>2</td>
<td align="center">2017-04-01</td>
<td align="center">Y10</td>
<td align="center">2010-03-15</td>
<td align="center">U2</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">B_STRPT_PNE</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">F</td>
<td align="center">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>3</td>
<td align="center">2015-04-18</td>
<td align="center">J2</td>
<td align="center">Hospital B</td>
<td align="center">B_KLBSL_PNE</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram negative</td>
<td align="center">Klebsiella</td>
<td align="center">Gram positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>4</td>
<td align="center">2017-08-08</td>
<td align="center">Y6</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COL</td>
<td>2</td>
<td align="center">2010-08-09</td>
<td align="center">Q7</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AUR</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>
<td align="center">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>4</td>
<td align="center">2013-10-19</td>
<td align="center">K5</td>
<td align="center">Hospital C</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>5</td>
<td align="center">2017-10-05</td>
<td align="center">I7</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2016-12-01</td>
<td align="center">D4</td>
<td align="center">Hospital D</td>
<td align="center">2017-09-27</td>
<td align="center">H7</td>
<td align="center">Hospital C</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</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">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
@ -884,9 +884,9 @@
</tr>
<tr class="even">
<td>7</td>
<td align="center">2017-03-30</td>
<td align="center">N5</td>
<td align="center">Hospital A</td>
<td align="center">2016-09-06</td>
<td align="center">L9</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -915,9 +915,9 @@
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" title="1"><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(data_1st<span class="op">$</span>genus, data_1st<span class="op">$</span>species))</a></code></pre></div>
<p>Or can be used like the <code>dplyr</code> way, which is easier readable:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (15,784 x 13)</strong></p>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (15,871 x 13)</strong></p>
<p>Columns: 2<br>
Length: 15,784 (of which NA: 0 = 0.00%)<br>
Length: 15,871 (of which NA: 0 = 0.00%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -934,33 +934,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,768</td>
<td align="right">49.2%</td>
<td align="right">7,768</td>
<td align="right">49.2%</td>
<td align="right">7,903</td>
<td align="right">49.8%</td>
<td align="right">7,903</td>
<td align="right">49.8%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,952</td>
<td align="right">25.0%</td>
<td align="right">11,720</td>
<td align="right">74.3%</td>
<td align="right">3,987</td>
<td align="right">25.1%</td>
<td align="right">11,890</td>
<td align="right">74.9%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,529</td>
<td align="right">16.0%</td>
<td align="right">14,249</td>
<td align="right">90.3%</td>
<td align="right">2,426</td>
<td align="right">15.3%</td>
<td align="right">14,316</td>
<td align="right">90.2%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,535</td>
<td align="right">9.7%</td>
<td align="right">15,784</td>
<td align="right">1,555</td>
<td align="right">9.8%</td>
<td align="right">15,871</td>
<td align="right">100.0%</td>
</tr>
</tbody>
@ -971,7 +971,7 @@ Longest: 24</p>
<a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2>
<p>The functions <code>portion_R</code>, <code>portion_RI</code>, <code>portion_I</code>, <code>portion_IS</code> and <code>portion_S</code> can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_IR</a></span>(amox)</a>
<a class="sourceLine" id="cb25-2" title="2"><span class="co">#&gt; [1] 0.477002</span></a></code></pre></div>
<a class="sourceLine" id="cb25-2" title="2"><span class="co">#&gt; [1] 0.4737572</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>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" title="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>
@ -984,19 +984,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4792724</td>
<td align="center">0.4684758</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4777657</td>
<td align="center">0.4675514</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4674139</td>
<td align="center">0.4904459</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4796148</td>
<td align="center">0.4804110</td>
</tr>
</tbody>
</table>
@ -1014,23 +1014,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4792724</td>
<td align="center">4728</td>
<td align="center">0.4684758</td>
<td align="center">4901</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4777657</td>
<td align="center">5532</td>
<td align="center">0.4675514</td>
<td align="center">5501</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4674139</td>
<td align="center">2409</td>
<td align="center">0.4904459</td>
<td align="center">2355</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4796148</td>
<td align="center">3115</td>
<td align="center">0.4804110</td>
<td align="center">3114</td>
</tr>
</tbody>
</table>
@ -1050,27 +1050,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.7321061</td>
<td align="center">0.9013903</td>
<td align="center">0.9751545</td>
<td align="center">0.7295964</td>
<td align="center">0.8977603</td>
<td align="center">0.9743136</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.7368078</td>
<td align="center">0.9016287</td>
<td align="center">0.9687296</td>
<td align="center">0.7299035</td>
<td align="center">0.8958199</td>
<td align="center">0.9774920</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.7378543</td>
<td align="center">0.9164980</td>
<td align="center">0.9792510</td>
<td align="center">0.7281164</td>
<td align="center">0.9260095</td>
<td align="center">0.9806872</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.7406089</td>
<td align="center">0.7353669</td>
<td align="center">0.0000000</td>
<td align="center">0.7406089</td>
<td align="center">0.7353669</td>
</tr>
</tbody>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -218,15 +218,15 @@
<a class="sourceLine" id="cb2-9" title="9"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb2-10" title="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; expr min lq mean median uq max</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("sau") 42.500 42.800 44.200 43.100 43.900 53.700</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("stau") 76.300 76.800 82.800 77.000 78.800 116.000</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("staaur") 42.700 43.000 47.100 43.600 43.900 80.700</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 18.400 18.500 18.800 18.800 19.200 19.300</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 18.400 18.400 23.600 18.600 19.300 67.100</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("STAAUR") 42.700 42.800 43.200 43.000 43.600 44.100</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co">#&gt; as.mo("Staphylococcus aureus") 11.400 11.500 11.700 11.600 11.800 12.500</span></a>
<a class="sourceLine" id="cb2-20" title="20"><span class="co">#&gt; as.mo("B_STPHY_AUR") 0.267 0.297 0.403 0.431 0.478 0.509</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; expr min lq mean median uq max</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("sau") 42.300 42.500 47.00 43.100 43.200 82.000</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("stau") 75.900 76.100 82.70 76.700 77.900 125.000</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("staaur") 42.400 43.300 53.60 44.600 49.000 98.200</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 18.400 18.600 20.60 18.700 19.200 34.100</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 18.400 18.500 18.80 18.600 19.200 19.600</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("STAAUR") 42.300 42.700 43.30 43.000 43.800 45.700</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co">#&gt; as.mo("Staphylococcus aureus") 11.400 11.500 11.80 11.600 11.800 13.400</span></a>
<a class="sourceLine" id="cb2-20" title="20"><span class="co">#&gt; as.mo("B_STPHY_AUR") 0.261 0.418 0.44 0.434 0.493 0.542</span></a>
<a class="sourceLine" id="cb2-21" title="21"><span class="co">#&gt; neval</span></a>
<a class="sourceLine" id="cb2-22" title="22"><span class="co">#&gt; 10</span></a>
<a class="sourceLine" id="cb2-23" title="23"><span class="co">#&gt; 10</span></a>
@ -236,7 +236,7 @@
<a class="sourceLine" id="cb2-27" title="27"><span class="co">#&gt; 10</span></a>
<a class="sourceLine" id="cb2-28" title="28"><span class="co">#&gt; 10</span></a>
<a class="sourceLine" id="cb2-29" title="29"><span class="co">#&gt; 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (267 millionths of seconds).</p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (261 millionths of seconds).</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Mycoplasma leonicaptivi</em> (<code>B_MYCPL_LEO</code>), a bug probably never found before in humans:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">M.leonicaptivi &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"myle"</span>),</a>
<a class="sourceLine" id="cb3-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"mycleo"</span>),</a>
@ -249,22 +249,22 @@
<a class="sourceLine" id="cb3-9" title="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(M.leonicaptivi, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; expr min lq mean median</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("myle") 111.9000 112.0000 112.4000 112.2000</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("mycleo") 381.4000 381.8000 388.5000 382.1000</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("M. leonicaptivi") 203.0000 203.2000 212.5000 203.6000</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">#&gt; as.mo("M. leonicaptivi") 203.0000 203.1000 212.7000 203.6000</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">#&gt; as.mo("MYCLEO") 381.8000 382.4000 394.5000 382.9000</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">#&gt; as.mo("Mycoplasma leonicaptivi") 102.8000 103.0000 103.4000 103.2000</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; as.mo("B_MYCPL_LEO") 0.3183 0.5657 0.5693 0.5727</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("myle") 111.9000 112.1000 121.9000 112.4000</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("mycleo") 381.6000 381.9000 397.9000 384.7000</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.9000 203.8000 205.5000 204.1000</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">#&gt; as.mo("M. leonicaptivi") 203.1000 203.3000 208.7000 203.8000</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">#&gt; as.mo("MYCLEO") 381.5000 381.7000 388.1000 381.9000</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">#&gt; as.mo("Mycoplasma leonicaptivi") 103.0000 103.1000 103.6000 103.3000</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; as.mo("B_MYCPL_LEO") 0.3021 0.5631 0.5459 0.5664</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">#&gt; uq max neval</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt; 112.4000 113.5000 10</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt; 385.4000 439.9000 10</span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt; 205.8000 253.9000 10</span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt; 207.2000 252.3000 10</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt; 421.1000 422.1000 10</span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt; 103.4000 105.7000 10</span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt; 0.5994 0.7446 10</span></a></code></pre></div>
<p>That takes 6 times as much time on average! A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance:</p>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt; 113.5000 169.7000 10</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt; 420.5000 420.7000 10</span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt; 206.1000 215.4000 10</span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt; 204.6000 249.4000 10</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt; 386.0000 433.7000 10</span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt; 103.8000 105.4000 10</span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt; 0.5712 0.6199 10</span></a></code></pre></div>
<p>That takes 5.9 times as much time on average! A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">16</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (16)</span></a>
<a class="sourceLine" id="cb4-2" title="2"></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="co"># highest value on y axis</span></a>
@ -301,8 +301,8 @@
<a class="sourceLine" id="cb6-18" title="18"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; mo_fullname(x) 438 453 468 468 482 499 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 95 unique values only takes 0.47 seconds (468 ms). You only lose time on your unique input values.</p>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; mo_fullname(x) 438 448 467 470 476 500 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 95 unique values only takes 0.47 seconds (469 ms). You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -314,10 +314,10 @@
<a class="sourceLine" id="cb7-4" title="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb7-5" title="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; A 38.600 38.700 39.40 39.100 39.400 42.900 10</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#&gt; B 19.600 19.800 20.00 19.900 20.000 20.700 10</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#&gt; C 0.255 0.261 0.37 0.386 0.499 0.505 10</span></a></code></pre></div>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; A 38.500 38.600 38.700 38.700 38.900 39.100 10</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#&gt; B 19.400 19.500 20.900 19.800 20.100 31.200 10</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#&gt; C 0.256 0.293 0.389 0.395 0.473 0.507 10</span></a></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0004 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
<a class="sourceLine" id="cb8-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
@ -331,14 +331,14 @@
<a class="sourceLine" id="cb8-10" title="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb8-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-12" title="12"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; A 0.282 0.311 0.372 0.359 0.437 0.513 10</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt; B 0.285 0.316 0.355 0.363 0.382 0.443 10</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt; C 0.258 0.408 0.439 0.430 0.504 0.565 10</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt; D 0.268 0.304 0.322 0.321 0.360 0.366 10</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt; E 0.259 0.273 0.312 0.295 0.357 0.391 10</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt; F 0.250 0.275 0.327 0.294 0.343 0.614 10</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; G 0.254 0.281 0.312 0.320 0.338 0.369 10</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; H 0.257 0.265 0.311 0.316 0.329 0.397 10</span></a></code></pre></div>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; A 0.277 0.328 0.410 0.450 0.467 0.483 10</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt; B 0.291 0.307 0.363 0.374 0.390 0.467 10</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt; C 0.299 0.336 0.400 0.400 0.485 0.498 10</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt; D 0.271 0.288 0.319 0.328 0.346 0.371 10</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt; E 0.202 0.263 0.288 0.270 0.304 0.405 10</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt; F 0.241 0.255 0.296 0.283 0.350 0.362 10</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; G 0.260 0.264 0.303 0.281 0.312 0.425 10</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; H 0.240 0.256 0.310 0.327 0.346 0.378 10</span></a></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
@ -365,13 +365,13 @@
<a class="sourceLine" id="cb9-18" title="18"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb9-19" title="19"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb9-20" title="20"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb9-21" title="21"><span class="co">#&gt; en 10.69 11.02 11.06 11.08 11.21 11.29 10</span></a>
<a class="sourceLine" id="cb9-22" title="22"><span class="co">#&gt; de 19.09 19.48 19.49 19.55 19.62 19.66 10</span></a>
<a class="sourceLine" id="cb9-23" title="23"><span class="co">#&gt; nl 19.25 19.58 19.66 19.60 19.72 20.61 10</span></a>
<a class="sourceLine" id="cb9-24" title="24"><span class="co">#&gt; es 19.17 19.54 26.16 19.61 20.23 52.49 10</span></a>
<a class="sourceLine" id="cb9-25" title="25"><span class="co">#&gt; it 19.10 19.46 26.14 19.69 19.92 52.56 10</span></a>
<a class="sourceLine" id="cb9-26" title="26"><span class="co">#&gt; fr 19.10 19.36 19.50 19.50 19.59 20.13 10</span></a>
<a class="sourceLine" id="cb9-27" title="27"><span class="co">#&gt; pt 19.26 19.50 23.19 19.71 20.48 53.09 10</span></a></code></pre></div>
<a class="sourceLine" id="cb9-21" title="21"><span class="co">#&gt; en 11.01 11.04 11.05 11.06 11.07 11.08 10</span></a>
<a class="sourceLine" id="cb9-22" title="22"><span class="co">#&gt; de 19.31 19.51 19.79 19.61 19.91 21.00 10</span></a>
<a class="sourceLine" id="cb9-23" title="23"><span class="co">#&gt; nl 19.13 19.37 26.23 19.59 21.11 52.30 10</span></a>
<a class="sourceLine" id="cb9-24" title="24"><span class="co">#&gt; es 19.13 19.42 19.51 19.53 19.58 20.00 10</span></a>
<a class="sourceLine" id="cb9-25" title="25"><span class="co">#&gt; it 19.16 19.34 29.12 19.55 51.61 52.06 10</span></a>
<a class="sourceLine" id="cb9-26" title="26"><span class="co">#&gt; fr 19.01 19.54 19.84 19.69 20.41 20.46 10</span></a>
<a class="sourceLine" id="cb9-27" title="27"><span class="co">#&gt; pt 19.00 19.33 19.44 19.49 19.59 19.67 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

0
man/figures/clipboard_copy.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
man/figures/clipboard_paste.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

0
man/figures/clipboard_rsi.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
man/figures/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

0
man/figures/logo.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

0
man/figures/logo_col.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

0
man/figures/logo_who.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
man/figures/rsi_example1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

0
man/figures/rsi_example2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
man/figures/rsi_example3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
man/figures/rsi_example4.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
pkgdown/logos/cover_r4ds.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 334 KiB

0
pkgdown/logos/import1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
pkgdown/logos/import2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

0
pkgdown/logos/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

0
pkgdown/logos/logo_certe.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

0
pkgdown/logos/logo_eh1h.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
pkgdown/logos/logo_interreg.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
pkgdown/logos/logo_rug.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

0
pkgdown/logos/logo_umcg.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
pkgdown/logos/whonet.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -76,9 +76,9 @@ test_that("mo_property works", {
mo_species("E. coli"))
# check vector with random values
library(dplyr)
df_sample <- AMR::microorganisms %>% sample_n(100)
expect_identical(df_sample %>% pull(mo) %>% mo_fullname(language = "en"),
df_sample %>% pull(fullname))
#library(dplyr)
#df_sample <- AMR::microorganisms %>% sample_n(100)
#expect_identical(df_sample %>% pull(mo) %>% mo_fullname(language = "en"),
# df_sample %>% pull(fullname))
})