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

Built site for AMR: 1.8.2.9024@74bcc41

This commit is contained in:
github-actions 2022-10-20 17:46:07 +00:00
parent f137d1a9e0
commit ca3fb70197
36 changed files with 450 additions and 452 deletions

View File

@ -325,70 +325,70 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2017-10-03</td>
<td align="center">E4</td>
<td align="center">Hospital B</td>
<td align="center">2010-07-04</td>
<td align="center">N1</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia 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">M</td>
</tr>
<tr class="even">
<td align="center">2015-05-08</td>
<td align="center">U7</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">2014-02-09</td>
<td align="center">T10</td>
<td align="center">Hospital C</td>
<td align="center">Streptococcus 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">F</td>
</tr>
<tr class="odd">
<td align="center">2017-03-19</td>
<td align="center">T10</td>
<td align="center">Hospital C</td>
<td align="center">2017-03-28</td>
<td align="center">P6</td>
<td align="center">Hospital B</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">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2014-07-20</td>
<td align="center">Y4</td>
<td align="center">2016-05-18</td>
<td align="center">E5</td>
<td align="center">Hospital A</td>
<td align="center">Streptococcus pneumoniae</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">M</td>
</tr>
<tr class="odd">
<td align="center">2016-10-10</td>
<td align="center">A2</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">2016-10-13</td>
<td align="center">F4</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia 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">M</td>
</tr>
<tr class="even">
<td align="center">2016-06-07</td>
<td align="center">H6</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">2013-09-14</td>
<td align="center">Y9</td>
<td align="center">Hospital D</td>
<td align="center">Streptococcus pneumoniae</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">F</td>
</tr>
</tbody>
</table>
@ -422,16 +422,16 @@ Longest: 1</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">M</td>
<td align="right">10,433</td>
<td align="right">52.16%</td>
<td align="right">10,433</td>
<td align="right">52.16%</td>
<td align="right">10,377</td>
<td align="right">51.89%</td>
<td align="right">10,377</td>
<td align="right">51.89%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">F</td>
<td align="right">9,567</td>
<td align="right">47.84%</td>
<td align="right">9,623</td>
<td align="right">48.12%</td>
<td align="right">20,000</td>
<td align="right">100.00%</td>
</tr>
@ -488,7 +488,7 @@ Longest: 1</p>
<span><span class="co"># Basing inclusion on all antimicrobial results, using a points threshold of</span></span>
<span><span class="co"># 2</span></span>
<span><span class="co"># Including isolates from ICU.</span></span>
<span><span class="co"># =&gt; Found 10,659 'phenotype-based' first isolates (53.3% of total where a</span></span>
<span><span class="co"># =&gt; Found 10,663 'phenotype-based' first isolates (53.3% of total where a</span></span>
<span><span class="co"># microbial ID was available)</span></span></code></pre></div>
<p>So only 53.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
@ -499,7 +499,7 @@ Longest: 1</p>
<code class="sourceCode R"><span><span class="va">data_1st</span> <span class="op">&lt;-</span> <span class="va">data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span>
<span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># Including isolates from ICU.</span></span></code></pre></div>
<p>So we end up with 10,659 isolates for analysis. Now our data looks like:</p>
<p>So we end up with 10,663 isolates for analysis. Now our data looks like:</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">data_1st</span><span class="op">)</span></span></code></pre></div>
<table style="width:100%;" class="table">
@ -537,92 +537,76 @@ Longest: 1</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="center">2017-10-03</td>
<td align="center">E4</td>
<td align="center">Hospital B</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">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 align="left">2</td>
<td align="center">2015-05-08</td>
<td align="center">U7</td>
<td align="center">Hospital A</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">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 align="left">3</td>
<td align="center">2017-03-19</td>
<td align="center">2014-02-09</td>
<td align="center">T10</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COLI</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">R</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="even">
<td align="left">5</td>
<td align="center">2016-10-10</td>
<td align="center">A2</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</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">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">9</td>
<td align="center">2011-08-27</td>
<td align="center">E1</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</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 align="left">14</td>
<td align="center">2016-07-02</td>
<td align="center">D8</td>
<td align="left">3</td>
<td align="center">2017-03-28</td>
<td align="center">P6</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</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">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="center">2016-10-13</td>
<td align="center">F4</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</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 align="left">6</td>
<td align="center">2013-09-14</td>
<td align="center">Y9</td>
<td align="center">Hospital D</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">R</td>
<td align="center">F</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="odd">
<td align="left">7</td>
<td align="center">2016-09-03</td>
<td align="center">A7</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</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>
@ -632,6 +616,22 @@ Longest: 1</p>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">11</td>
<td align="center">2012-12-21</td>
<td align="center">O1</td>
<td align="center">Hospital A</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">R</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Time for the analysis!</p>
@ -653,8 +653,8 @@ Longest: 1</p>
<code class="sourceCode R"><span><span class="va">data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">genus</span>, <span class="va">species</span><span class="op">)</span></span></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 10,659<br>
Available: 10,659 (100.0%, NA: 0 = 0.0%)<br>
Length: 10,663<br>
Available: 10,663 (100.0%, NA: 0 = 0.0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -671,33 +671,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">4,656</td>
<td align="right">43.68%</td>
<td align="right">4,656</td>
<td align="right">43.68%</td>
<td align="right">4,612</td>
<td align="right">43.25%</td>
<td align="right">4,612</td>
<td align="right">43.25%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">2,663</td>
<td align="right">24.98%</td>
<td align="right">7,319</td>
<td align="right">68.66%</td>
<td align="right">2,732</td>
<td align="right">25.62%</td>
<td align="right">7,344</td>
<td align="right">68.87%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,150</td>
<td align="right">2,151</td>
<td align="right">20.17%</td>
<td align="right">9,469</td>
<td align="right">88.84%</td>
<td align="right">9,495</td>
<td align="right">89.05%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,190</td>
<td align="right">11.16%</td>
<td align="right">10,659</td>
<td align="right">1,168</td>
<td align="right">10.95%</td>
<td align="right">10,663</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -716,14 +716,14 @@ Longest: 24</p>
<col width="9%">
<col width="9%">
<col width="9%">
<col width="10%">
<col width="11%">
<col width="3%">
<col width="3%">
<col width="3%">
<col width="3%">
<col width="6%">
<col width="11%">
<col width="12%">
<col width="11%">
<col width="9%">
<col width="5%">
</colgroup>
@ -744,9 +744,69 @@ Longest: 24</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2017-03-19</td>
<td align="center">2014-02-09</td>
<td align="center">T10</td>
<td align="center">Hospital C</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">R</td>
<td align="center">F</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 align="center">2013-09-14</td>
<td align="center">Y9</td>
<td align="center">Hospital D</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">R</td>
<td align="center">F</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="odd">
<td align="center">2012-12-21</td>
<td align="center">O1</td>
<td align="center">Hospital A</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">R</td>
<td align="center">F</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 align="center">2011-07-03</td>
<td align="center">S2</td>
<td align="center">Hospital B</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">R</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 align="center">2010-04-27</td>
<td align="center">Y1</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -759,78 +819,18 @@ Longest: 24</p>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2011-08-27</td>
<td align="center">E1</td>
<td align="center">2017-06-16</td>
<td align="center">V4</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNMN</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>
<td align="center">M</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="odd">
<td align="center">2011-07-28</td>
<td align="center">L7</td>
<td align="center">Hospital B</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">R</td>
<td align="center">M</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 align="center">2013-02-23</td>
<td align="center">O8</td>
<td align="center">Hospital C</td>
<td align="center">B_STPHY_AURS</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">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2015-07-29</td>
<td align="center">V3</td>
<td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</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 align="center">2011-04-12</td>
<td align="center">B4</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -854,50 +854,50 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">AMX</td>
<td align="center">2234</td>
<td align="center">119</td>
<td align="center">2303</td>
<td align="center">4656</td>
<td align="center">2181</td>
<td align="center">134</td>
<td align="center">2297</td>
<td align="center">4612</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">AMC</td>
<td align="center">3425</td>
<td align="center">159</td>
<td align="center">1072</td>
<td align="center">4656</td>
<td align="center">3388</td>
<td align="center">167</td>
<td align="center">1057</td>
<td align="center">4612</td>
</tr>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">3372</td>
<td align="center">3355</td>
<td align="center">0</td>
<td align="center">1284</td>
<td align="center">4656</td>
<td align="center">1257</td>
<td align="center">4612</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">4049</td>
<td align="center">4036</td>
<td align="center">0</td>
<td align="center">607</td>
<td align="center">4656</td>
<td align="center">576</td>
<td align="center">4612</td>
</tr>
<tr class="odd">
<td align="center">K. pneumoniae</td>
<td align="center">AMX</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">1190</td>
<td align="center">1190</td>
<td align="center">1168</td>
<td align="center">1168</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">AMC</td>
<td align="center">914</td>
<td align="center">41</td>
<td align="center">235</td>
<td align="center">1190</td>
<td align="center">912</td>
<td align="center">43</td>
<td align="center">213</td>
<td align="center">1168</td>
</tr>
</tbody>
</table>
@ -920,34 +920,34 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">4049</td>
<td align="center">4036</td>
<td align="center">0</td>
<td align="center">607</td>
<td align="center">4656</td>
<td align="center">576</td>
<td align="center">4612</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">GEN</td>
<td align="center">1059</td>
<td align="center">1042</td>
<td align="center">0</td>
<td align="center">131</td>
<td align="center">1190</td>
<td align="center">126</td>
<td align="center">1168</td>
</tr>
<tr class="odd">
<td align="center">S. aureus</td>
<td align="center">GEN</td>
<td align="center">2365</td>
<td align="center">2433</td>
<td align="center">0</td>
<td align="center">298</td>
<td align="center">2663</td>
<td align="center">299</td>
<td align="center">2732</td>
</tr>
<tr class="even">
<td align="center">S. pneumoniae</td>
<td align="center">GEN</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">2150</td>
<td align="center">2150</td>
<td align="center">2151</td>
<td align="center">2151</td>
</tr>
</tbody>
</table>
@ -961,7 +961,7 @@ Longest: 24</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span><span class="op">(</span><span class="va">AMX</span><span class="op">)</span></span>
<span><span class="co"># [1] 0.5378553</span></span></code></pre></div>
<span><span class="co"># [1] 0.5430929</span></span></code></pre></div>
<p>Or can be used in conjunction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html" class="external-link">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb27"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span>
@ -975,19 +975,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5398944</td>
<td align="center">0.5517885</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5323505</td>
<td align="center">0.5364807</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.5494168</td>
<td align="center">0.5249089</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5354147</td>
<td align="center">0.5559306</td>
</tr>
</tbody>
</table>
@ -1008,23 +1008,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5398944</td>
<td align="center">3221</td>
<td align="center">0.5517885</td>
<td align="center">3215</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5323505</td>
<td align="center">3663</td>
<td align="center">0.5364807</td>
<td align="center">3728</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.5494168</td>
<td align="center">1629</td>
<td align="center">0.5249089</td>
<td align="center">1646</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5354147</td>
<td align="center">2146</td>
<td align="center">0.5559306</td>
<td align="center">2074</td>
</tr>
</tbody>
</table>
@ -1047,27 +1047,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.7697595</td>
<td align="center">0.8696306</td>
<td align="center">0.9765893</td>
<td align="center">0.7708153</td>
<td align="center">0.8751084</td>
<td align="center">0.9754987</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.8025210</td>
<td align="center">0.8899160</td>
<td align="center">0.9781513</td>
<td align="center">0.8176370</td>
<td align="center">0.8921233</td>
<td align="center">0.9803082</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.7972212</td>
<td align="center">0.8880961</td>
<td align="center">0.9831018</td>
<td align="center">0.7877013</td>
<td align="center">0.8905564</td>
<td align="center">0.9802343</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.5530233</td>
<td align="center">0.5281265</td>
<td align="center">0.0000000</td>
<td align="center">0.5530233</td>
<td align="center">0.5281265</td>
</tr>
</tbody>
</table>
@ -1092,23 +1092,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="left">Hospital A</td>
<td align="right">54.0%</td>
<td align="right">25.8%</td>
<td align="right">55.2%</td>
<td align="right">28.5%</td>
</tr>
<tr class="even">
<td align="left">Hospital B</td>
<td align="right">53.2%</td>
<td align="right">26.7%</td>
<td align="right">53.6%</td>
<td align="right">25.4%</td>
</tr>
<tr class="odd">
<td align="left">Hospital C</td>
<td align="right">54.9%</td>
<td align="right">26.8%</td>
<td align="right">52.5%</td>
<td align="right">26.3%</td>
</tr>
<tr class="even">
<td align="left">Hospital D</td>
<td align="right">53.5%</td>
<td align="right">26.2%</td>
<td align="right">55.6%</td>
<td align="right">27.4%</td>
</tr>
</tbody>
</table>
@ -1206,18 +1206,18 @@ Longest: 24</p>
<code class="sourceCode R"><span><span class="va">mic_values</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/random.html">random_mic</a></span><span class="op">(</span>size <span class="op">=</span> <span class="fl">100</span><span class="op">)</span></span>
<span><span class="va">mic_values</span></span>
<span><span class="co"># Class 'mic'</span></span>
<span><span class="co"># [1] 0.01 0.025 128 0.25 0.01 0.025 8 0.005 0.01 </span></span>
<span><span class="co"># [10] 0.5 0.01 0.025 &lt;=0.001 128 0.0625 0.5 0.005 4 </span></span>
<span><span class="co"># [19] 0.5 0.25 16 0.005 16 16 0.5 &lt;=0.001 4 </span></span>
<span><span class="co"># [28] 8 0.0625 16 2 4 &lt;=0.001 0.125 0.002 32 </span></span>
<span><span class="co"># [37] 0.0625 0.5 0.5 0.5 0.125 4 0.01 4 8 </span></span>
<span><span class="co"># [46] 64 128 256 128 2 1 256 2 8 </span></span>
<span><span class="co"># [55] 0.01 &lt;=0.001 0.01 0.25 32 &lt;=0.001 2 1 0.005 </span></span>
<span><span class="co"># [64] 4 256 0.025 32 2 64 128 32 &lt;=0.001</span></span>
<span><span class="co"># [73] 16 0.005 0.5 0.25 4 2 0.5 32 64 </span></span>
<span><span class="co"># [82] 0.005 64 256 0.005 256 0.0625 256 0.005 64 </span></span>
<span><span class="co"># [91] 0.005 0.005 0.005 0.002 0.25 8 32 4 1 </span></span>
<span><span class="co"># [100] 0.0625</span></span></code></pre></div>
<span><span class="co"># [1] 32 0.025 4 0.01 32 &lt;=0.001 0.0625 0.002 0.125 </span></span>
<span><span class="co"># [10] 4 64 64 0.01 0.005 64 0.125 8 1 </span></span>
<span><span class="co"># [19] 0.25 0.002 0.01 16 0.01 256 32 2 0.005 </span></span>
<span><span class="co"># [28] 8 0.002 0.125 0.025 0.005 1 0.025 4 0.005 </span></span>
<span><span class="co"># [37] 4 &lt;=0.001 64 32 0.025 0.125 1 64 0.002 </span></span>
<span><span class="co"># [46] 0.005 0.5 0.005 0.0625 0.5 0.125 1 0.25 0.025 </span></span>
<span><span class="co"># [55] 1 0.005 0.002 0.0625 2 32 0.01 0.0625 16 </span></span>
<span><span class="co"># [64] 0.005 0.125 0.01 4 0.5 4 2 0.01 0.25 </span></span>
<span><span class="co"># [73] 16 &lt;=0.001 0.0625 0.0625 64 16 0.0625 0.25 0.01 </span></span>
<span><span class="co"># [82] 256 128 64 16 0.25 8 64 0.002 &lt;=0.001</span></span>
<span><span class="co"># [91] 256 &lt;=0.001 32 0.5 16 &lt;=0.001 0.5 16 0.5 </span></span>
<span><span class="co"># [100] 16</span></span></code></pre></div>
<div class="sourceCode" id="cb37"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span>
<span><span class="fu"><a href="../reference/plot.html">plot</a></span><span class="op">(</span><span class="va">mic_values</span><span class="op">)</span></span></code></pre></div>
@ -1244,10 +1244,10 @@ Longest: 24</p>
<code class="sourceCode R"><span><span class="va">disk_values</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/random.html">random_disk</a></span><span class="op">(</span>size <span class="op">=</span> <span class="fl">100</span>, mo <span class="op">=</span> <span class="st">"E. coli"</span>, ab <span class="op">=</span> <span class="st">"cipro"</span><span class="op">)</span></span>
<span><span class="va">disk_values</span></span>
<span><span class="co"># Class 'disk'</span></span>
<span><span class="co"># [1] 20 22 22 23 28 28 28 22 21 18 27 22 21 21 29 19 24 24 26 22 28 21 17 30 22</span></span>
<span><span class="co"># [26] 27 28 23 31 18 25 17 23 25 26 28 24 18 29 29 17 18 20 21 23 26 27 28 18 17</span></span>
<span><span class="co"># [51] 18 24 23 23 17 31 24 19 23 19 27 28 30 30 28 21 19 24 29 26 19 19 18 20 25</span></span>
<span><span class="co"># [76] 26 27 31 27 20 31 31 18 30 23 18 19 26 19 31 28 30 18 21 18 17 21 30 20 28</span></span></code></pre></div>
<span><span class="co"># [1] 28 27 22 29 26 26 28 22 31 20 23 18 26 31 28 18 17 19 17 23 19 21 27 28 24</span></span>
<span><span class="co"># [26] 30 27 22 21 24 28 28 24 18 31 31 17 17 30 30 17 30 26 27 21 17 28 20 21 27</span></span>
<span><span class="co"># [51] 31 28 23 24 30 19 27 30 24 29 23 26 22 24 17 17 31 20 27 20 22 29 27 28 30</span></span>
<span><span class="co"># [76] 20 31 25 29 20 29 27 28 29 20 30 27 21 23 24 24 26 18 26 27 19 25 26 28 24</span></span></code></pre></div>
<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span>
<span><span class="fu"><a href="../reference/plot.html">plot</a></span><span class="op">(</span><span class="va">disk_values</span>, mo <span class="op">=</span> <span class="st">"E. coli"</span>, ab <span class="op">=</span> <span class="st">"cipro"</span><span class="op">)</span></span></code></pre></div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -314,19 +314,19 @@ Unique: 2</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span></span>
<span><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
<span><span class="co"># 1 S R I I I R</span></span>
<span><span class="co"># 2 I S R R R R</span></span>
<span><span class="co"># 3 R I I S I S</span></span>
<span><span class="co"># 4 R R R R I S</span></span>
<span><span class="co"># 5 I S I R I R</span></span>
<span><span class="co"># 6 R S R S S I</span></span>
<span><span class="co"># 1 S I I S I S</span></span>
<span><span class="co"># 2 R I I R R R</span></span>
<span><span class="co"># 3 S I S S S R</span></span>
<span><span class="co"># 4 R S R I R S</span></span>
<span><span class="co"># 5 I R I I R I</span></span>
<span><span class="co"># 6 S I I S I S</span></span>
<span><span class="co"># kanamycin</span></span>
<span><span class="co"># 1 S</span></span>
<span><span class="co"># 1 R</span></span>
<span><span class="co"># 2 I</span></span>
<span><span class="co"># 3 S</span></span>
<span><span class="co"># 4 R</span></span>
<span><span class="co"># 3 R</span></span>
<span><span class="co"># 4 I</span></span>
<span><span class="co"># 5 I</span></span>
<span><span class="co"># 6 I</span></span></code></pre></div>
<span><span class="co"># 6 S</span></span></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">my_TB_data</span>, guideline <span class="op">=</span> <span class="st">"TB"</span><span class="op">)</span></span></code></pre></div>
@ -357,40 +357,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3227</td>
<td align="right">64.54%</td>
<td align="right">3227</td>
<td align="right">64.54%</td>
<td align="right">3202</td>
<td align="right">64.04%</td>
<td align="right">3202</td>
<td align="right">64.04%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">945</td>
<td align="right">18.90%</td>
<td align="right">4172</td>
<td align="right">83.44%</td>
<td align="right">995</td>
<td align="right">19.90%</td>
<td align="right">4197</td>
<td align="right">83.94%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">459</td>
<td align="right">9.18%</td>
<td align="right">4631</td>
<td align="right">92.62%</td>
<td align="right">443</td>
<td align="right">8.86%</td>
<td align="right">4640</td>
<td align="right">92.80%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">260</td>
<td align="right">5.20%</td>
<td align="right">4891</td>
<td align="right">97.82%</td>
<td align="right">4900</td>
<td align="right">98.00%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">109</td>
<td align="right">2.18%</td>
<td align="right">100</td>
<td align="right">2.00%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

View File

@ -177,7 +177,7 @@
</h2>
<p>A data set with 48,787 rows and 22 columns, containing the following column names:<br><em>mo</em>, <em>fullname</em>, <em>status</em>, <em>kingdom</em>, <em>phylum</em>, <em>class</em>, <em>order</em>, <em>family</em>, <em>genus</em>, <em>species</em>, <em>subspecies</em>, <em>rank</em>, <em>ref</em>, <em>source</em>, <em>lpsn</em>, <em>lpsn_parent</em>, <em>lpsn_renamed_to</em>, <em>gbif</em>, <em>gbif_parent</em>, <em>gbif_renamed_to</em>, <em>prevalence</em> and <em>snomed</em>.</p>
<p>This data set is in R available as <code>microorganisms</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/microorganisms.rds" class="external-link">original R Data Structure (RDS) file</a> (1.1 MB)<br>
@ -449,7 +449,7 @@
</h2>
<p>A data set with 464 rows and 14 columns, containing the following column names:<br><em>ab</em>, <em>cid</em>, <em>name</em>, <em>group</em>, <em>atc</em>, <em>atc_group1</em>, <em>atc_group2</em>, <em>abbreviations</em>, <em>synonyms</em>, <em>oral_ddd</em>, <em>oral_units</em>, <em>iv_ddd</em>, <em>iv_units</em> and <em>loinc</em>.</p>
<p>This data set is in R available as <code>antibiotics</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/antibiotics.rds" class="external-link">original R Data Structure (RDS) file</a> (36 kB)<br>
@ -622,7 +622,7 @@
</h2>
<p>A data set with 102 rows and 9 columns, containing the following column names:<br><em>atc</em>, <em>cid</em>, <em>name</em>, <em>atc_group</em>, <em>synonyms</em>, <em>oral_ddd</em>, <em>oral_units</em>, <em>iv_ddd</em> and <em>iv_units</em>.</p>
<p>This data set is in R available as <code>antivirals</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/antivirals.rds" class="external-link">original R Data Structure (RDS) file</a> (4 kB)<br>
@ -754,7 +754,7 @@
</h2>
<p>A data set with 20,369 rows and 11 columns, containing the following column names:<br><em>guideline</em>, <em>method</em>, <em>site</em>, <em>mo</em>, <em>rank_index</em>, <em>ab</em>, <em>ref_tbl</em>, <em>disk_dose</em>, <em>breakpoint_S</em>, <em>breakpoint_R</em> and <em>uti</em>.</p>
<p>This data set is in R available as <code>rsi_translation</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/rsi_translation.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/rsi_translation.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/rsi_translation.rds" class="external-link">original R Data Structure (RDS) file</a> (49 kB)<br>
@ -913,7 +913,7 @@
</h2>
<p>A data set with 134,659 rows and 2 columns, containing the following column names:<br><em>mo</em> and <em>ab</em>.</p>
<p>This data set is in R available as <code>intrinsic_resistant</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/intrinsic_resistant.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/intrinsic_resistant.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/intrinsic_resistant.rds" class="external-link">original R Data Structure (RDS) file</a> (78 kB)<br>
@ -1185,7 +1185,7 @@
</h2>
<p>A data set with 169 rows and 9 columns, containing the following column names:<br><em>ab</em>, <em>name</em>, <em>type</em>, <em>dose</em>, <em>dose_times</em>, <em>administration</em>, <em>notes</em>, <em>original_txt</em> and <em>eucast_version</em>.</p>
<p>This data set is in R available as <code>dosage</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/dosage.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/dosage.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/dosage.rds" class="external-link">original R Data Structure (RDS) file</a> (3 kB)<br>
@ -1302,7 +1302,7 @@
</h2>
<p>A data set with 2,000 rows and 46 columns, containing the following column names:<br><em>date</em>, <em>patient</em>, <em>age</em>, <em>gender</em>, <em>ward</em>, <em>mo</em>, <em>PEN</em>, <em>OXA</em>, <em>FLC</em>, <em>AMX</em>, <em>AMC</em>, <em>AMP</em>, <em>TZP</em>, <em>CZO</em>, <em>FEP</em>, <em>CXM</em>, <em>FOX</em>, <em>CTX</em>, <em>CAZ</em>, <em>CRO</em>, <em>GEN</em>, <em>TOB</em>, <em>AMK</em>, <em>KAN</em>, <em>TMP</em>, <em>SXT</em>, <em>NIT</em>, <em>FOS</em>, <em>LNZ</em>, <em>CIP</em>, <em>MFX</em>, <em>VAN</em>, <em>TEC</em>, <em>TCY</em>, <em>TGC</em>, <em>DOX</em>, <em>ERY</em>, <em>CLI</em>, <em>AZM</em>, <em>IPM</em>, <em>MEM</em>, <em>MTR</em>, <em>CHL</em>, <em>COL</em>, <em>MUP</em> and <em>RIF</em>.</p>
<p>This data set is in R available as <code>example_isolates</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/example_isolates.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/example_isolates.html">here</a>.</p>
<div class="section level3">
<h3 id="source-6">Source<a class="anchor" aria-label="anchor" href="#source-6"></a>
</h3>
@ -1707,7 +1707,7 @@
</h2>
<p>A data set with 3,000 rows and 8 columns, containing the following column names:<br><em>patient_id</em>, <em>hospital</em>, <em>date</em>, <em>bacteria</em>, <em>AMX</em>, <em>AMC</em>, <em>CIP</em> and <em>GEN</em>.</p>
<p>This data set is in R available as <code>example_isolates_unclean</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 20 October 2022 14:08:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/example_isolates_unclean.html">here</a>.</p>
<p>It was last updated on 20 October 2022 17:39:59 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/example_isolates_unclean.html">here</a>.</p>
<div class="section level3">
<h3 id="source-7">Source<a class="anchor" aria-label="anchor" href="#source-7"></a>
</h3>

View File

@ -11,7 +11,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
last_built: 2022-10-20T14:11Z
last_built: 2022-10-20T17:42Z
urls:
reference: https://msberends.github.io/AMR/reference
article: https://msberends.github.io/AMR/articles

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -190,16 +190,16 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">df</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> birth_date age age_exact age_at_y2k</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1968-06-09 54 54.36438 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1986-02-19 36 36.66575 13</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1936-04-08 86 86.53425 63</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1965-09-02 57 57.13151 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1945-04-27 77 77.48219 54</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1988-02-16 34 34.67397 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1953-02-11 69 69.68767 46</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1976-01-29 46 46.72329 23</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1944-01-06 78 78.78630 55</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1997-02-24 25 25.65205 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1955-02-11 67 67.68767 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1965-04-20 57 57.50137 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1995-01-28 27 27.72603 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1979-03-04 43 43.63014 20</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1975-09-03 47 47.12877 24</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1990-02-11 32 32.68767 9</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1994-05-12 28 28.44110 5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1980-04-21 42 42.49863 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1945-01-06 77 77.78630 54</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1938-06-07 84 84.36986 61</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -484,16 +484,16 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 50 × 13</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> datetime index ab_input ab_consid…¹ mo_in…² mo_conside…³ guide…⁴</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;ab&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 2022-10-20 <span style="color: #949494;">14:11:52</span> 1 ampicillin AMP Strep … B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2022-10-20 <span style="color: #949494;">14:11:52</span> 1 AMP AMP Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2022-10-20 <span style="color: #949494;">14:11:53</span> 1 CIP CIP Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2022-10-20 <span style="color: #949494;">14:11:53</span> 1 GEN GEN Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 2022-10-20 <span style="color: #949494;">14:11:53</span> 1 TOB TOB Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 2022-10-20 <span style="color: #949494;">14:11:53</span> 1 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 2022-10-20 <span style="color: #949494;">14:11:54</span> 1 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 2022-10-20 <span style="color: #949494;">14:11:54</span> 2 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2022-10-20 <span style="color: #949494;">14:11:54</span> 3 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 2022-10-20 <span style="color: #949494;">14:11:54</span> 4 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 2022-10-20 <span style="color: #949494;">17:43:03</span> 1 ampicillin AMP Strep … B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2022-10-20 <span style="color: #949494;">17:43:03</span> 1 AMP AMP Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2022-10-20 <span style="color: #949494;">17:43:03</span> 1 CIP CIP Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2022-10-20 <span style="color: #949494;">17:43:04</span> 1 GEN GEN Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 2022-10-20 <span style="color: #949494;">17:43:04</span> 1 TOB TOB Escher… B_ESCHR_COLI EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 2022-10-20 <span style="color: #949494;">17:43:04</span> 1 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 2022-10-20 <span style="color: #949494;">17:43:05</span> 1 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 2022-10-20 <span style="color: #949494;">17:43:05</span> 2 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2022-10-20 <span style="color: #949494;">17:43:05</span> 3 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 2022-10-20 <span style="color: #949494;">17:43:05</span> 4 AMX AMX B_STRP… B_STRPT_PNMN EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 40 more rows, 6 more variables: ref_table &lt;chr&gt;, method &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># breakpoint_S &lt;dbl&gt;, breakpoint_R &lt;dbl&gt;, input &lt;dbl&gt;, interpretation &lt;rsi&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and abbreviated variable names ¹ab_considered, ²mo_input, ³mo_considered,</span></span>

View File

@ -177,42 +177,42 @@
<span class="r-in"><span><span class="va">df</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></span><span class="op">(</span><span class="fl">2000</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">200</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 54 24 6 7 33 20 44 53 63 25 55 56 49 61 62 9 8 45 9 36 17 37 2 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 35 20 13 11 23 63 59 61 43 59 41 25 22 12 46 18 62 57 17 27 8 36 29 24 41</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 58 35 61 48 12 18 3 31 20 41 56 9 56 51 64 16 1 36 40 50 53 19 25 36 12</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 20 9 18 36 62 29 51 45 12 10 23 40 3 38 5 15 7 17 21 3 63 38 40 7 14</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [101] 63 7 17 15 51 17 62 2 61 12 52 32 46 32 27 4 13 61 19 37 41 38 51 22 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [126] 41 14 12 29 64 58 52 57 46 57 33 56 16 34 26 5 34 17 42 63 61 22 58 20 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [151] 25 38 25 17 12 22 56 28 13 34 3 47 25 63 16 1 5 1 22 39 31 14 31 51 30</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [176] 1 61 46 6 27 19 1 56 40 30 20 10 57 60 18 24 60 30 22 47 23 62 26 62 5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 51 1 30 33 57 38 63 41 55 28 20 27 45 11 12 55 39 3 21 59 25 21 9 2 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 5 49 24 11 32 51 28 21 38 57 36 11 54 24 36 60 6 50 31 60 47 43 20 54 10</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 40 35 12 62 31 42 41 37 9 20 1 2 34 48 46 45 51 36 59 45 62 28 54 26 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 44 49 28 19 17 10 62 40 6 8 38 51 32 5 37 46 7 61 51 38 27 52 33 58 39</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [101] 38 1 41 7 48 43 9 17 14 31 16 60 19 54 54 28 24 31 54 35 54 3 6 15 18</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [126] 48 34 34 60 29 41 12 19 57 54 50 45 17 56 62 10 28 13 28 4 33 53 54 47 22</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [151] 56 31 9 49 40 61 33 11 50 27 23 24 44 15 4 8 30 48 28 61 62 3 40 60 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [176] 21 26 25 4 13 10 3 8 54 63 48 64 64 44 42 47 58 53 14 8 52 22 13 17 23</span>
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] FALSE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [109] FALSE FALSE FALSE TRUE FALSE FALSE TRUE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [121] FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [133] FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [157] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [169] FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [181] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [193] FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [109] TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [121] FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [133] FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [157] FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [169] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [181] FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [193] TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 4 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;rsi&gt;</span> <span style="color: #949494; font-style: italic;">&lt;rsi&gt;</span> <span style="color: #949494; font-style: italic;">&lt;rsi&gt;</span> <span style="color: #949494; font-style: italic;">&lt;rsi&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-08-19 A49852 70 M Clinical B_ESCHR_COLI R NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-07-16 241328 78 M Outpatie… B_STPHY_CONS R NA S R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2002-06-23 798871 82 M Clinical B_ENTRC_FCLS NA NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2002-06-22 FD8039 75 F ICU B_ESCHR_COLI R NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-10-11 974319 78 M Outpatie… B_STPHY_EPDR S NA S NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-08-31 149442 80 F ICU B_STPHY_AURS R NA S R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2002-10-18 E55128 57 F ICU B_STPHY_AURS R NA S R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2002-09-23 F35553 51 M ICU B_STPHY_AURS S NA S NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 36 more variables: AMC &lt;rsi&gt;, AMP &lt;rsi&gt;, TZP &lt;rsi&gt;, CZO &lt;rsi&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># FEP &lt;rsi&gt;, CXM &lt;rsi&gt;, FOX &lt;rsi&gt;, CTX &lt;rsi&gt;, CAZ &lt;rsi&gt;, CRO &lt;rsi&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># GEN &lt;rsi&gt;, TOB &lt;rsi&gt;, AMK &lt;rsi&gt;, KAN &lt;rsi&gt;, TMP &lt;rsi&gt;, SXT &lt;rsi&gt;,</span></span>
@ -248,16 +248,16 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: condition [3]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient date condition new_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 687590 2011-10-29 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> C54153 2015-08-09 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 1710B8 2008-01-22 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 914520 2003-07-11 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 999565 2003-10-09 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 953526 2010-04-23 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 418311 2006-11-10 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 298662 2013-03-12 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2C8499 2015-05-22 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> F67215 2017-08-15 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> D53062 2014-07-28 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 495616 2002-01-17 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 534816 2008-10-28 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> D30712 2009-04-10 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 092034 2016-08-07 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 080086 2010-08-08 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 470001 2017-10-04 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> F15984 2011-04-01 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D41749 2015-12-15 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 945BD5 2008-05-06 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 190 more rows</span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="va">df</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
@ -269,19 +269,19 @@
<span class="r-in"><span> <span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 200 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [189]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2011-10-29 687590 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2015-08-09 C54153 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2008-01-22 1710B8 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2003-07-11 914520 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2003-10-09 999565 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2010-04-23 953526 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2006-11-10 418311 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2013-03-12 298662 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU 2015-05-22 2C8499 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2017-08-15 F67215 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [185]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2014-07-28 D53062 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2002-01-17 495616 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2008-10-28 534816 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2009-04-10 D30712 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2016-08-07 092034 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2010-08-08 080086 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2017-10-04 470001 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Outpatient 2011-04-01 F15984 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2015-12-15 D41749 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2008-05-06 945BD5 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 190 more rows</span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="va">df</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
@ -296,9 +296,9 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 119 14 48 72</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 59 14 37 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 11 8 9 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 116 14 53 71</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 52 11 32 40</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 17 10 16 17</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span> <span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
@ -328,19 +328,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 200 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [193]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 687590 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> C54153 B_STPHY_EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 1710B8 B_PROTS_MRBL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 914520 B_STPHY_CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 999565 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 953526 B_STPHY_CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 418311 B_STPHY_CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 298662 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2C8499 B_ESCHR_COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> F67215 B_STPHY_EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [190]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> D53062 B_HMPHL_INFL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 495616 B_STPHY_EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 534816 F_CANDD_ALBC Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> D30712 B_STRPT_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 092034 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 080086 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 470001 B_KLBSL_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> F15984 B_STPHY_CONS Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D41749 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 945BD5 B_ENTRBC_CLOC Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 190 more rows</span></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>

View File

@ -167,9 +167,9 @@
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 3.100538</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.993252</span>
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.02950212</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.03411978</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -195,11 +195,10 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">x</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">x</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 4 128 2 4 256 &lt;=0.001 &lt;=0.001 4 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.01 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 64 128 0.01 0.001 128 0.025 16 4 64 0.25 </span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">x</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.38501534 1.16834939 0.22834853 0.38501534 1.32501620 -1.48962591</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -1.48962591 0.38501534 0.07168172 -0.96919003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.8219432 0.9802175 -1.1792542 -1.7050300 0.9802175 -0.9700270</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.5053947 0.1888461 0.8219432 -0.4442511</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">y</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
<span class="r-in"><span> id <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>,</span></span>
@ -209,38 +208,38 @@
<span class="r-in"><span> tobr <span class="op">=</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span>, ab <span class="op">=</span> <span class="st">"tobr"</span>, mo <span class="op">=</span> <span class="st">"Escherichia coli"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">y</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.25 1 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B &lt;=2 &gt;=2 1 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &lt;=2 0.025 0.5 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 4 &gt;=2 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &gt;=16 0.025 4 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F &gt;=16 0.125 0.5 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G &lt;=2 &gt;=2 0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H &lt;=2 0.025 2 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I &gt;=16 0.0625 0.25 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J 8 0.025 4 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.125 2 &gt;=4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 8 0.25 8 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &lt;=2 1 2 &gt;=4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 8 1 8 &gt;=4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &lt;=2 1 2 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F &lt;=2 &lt;=0.025 1 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G 8 0.0625 1 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H &lt;=2 2 8 &gt;=4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I 8 0.125 0.5 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J &gt;=16 0.5 16 &gt;=4</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "id" and "tobr"</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>NAs introduced by coercion</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.2679478 -0.2300449 -0.6609425 0.2703257 0.6591997 0.3959389</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.1096818 -0.4920944 -0.4283259 0.3276773</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.07272768 0.02436854 0.07054523 0.81400616 -0.47677206 -1.27310062</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.30764224 0.49475116 -0.33800496 1.06457646</span>
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op">&lt;-</span> <span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span>, <span class="fu">where</span><span class="op">(</span><span class="va">is.mic</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Calculating mean AMR distance based on columns "amox", "cipr", "gent" and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "tobr"</span>
<span class="r-in"><span><span class="va">y</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></span><span class="op">(</span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &lt;=2 0.025 0.5 4 -0.6609425</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H &lt;=2 0.025 2 2 -0.4920944</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I &gt;=16 0.0625 0.25 &lt;=1 -0.4283259</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B &lt;=2 &gt;=2 1 &lt;=1 -0.2300449</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G &lt;=2 &gt;=2 0.25 8 -0.1096818</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.25 1 &gt;=16 0.2679478</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 4 &gt;=2 4 &lt;=1 0.2703257</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J 8 0.025 4 8 0.3276773</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F &gt;=16 0.125 0.5 &gt;=16 0.3959389</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &gt;=16 0.025 4 &gt;=16 0.6591997</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F &lt;=2 &lt;=0.025 1 &lt;=0.5 -1.27310062</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &lt;=2 1 2 &lt;=0.5 -0.47677206</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I 8 0.125 0.5 2 -0.33800496</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G 8 0.0625 1 2 -0.30764224</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.125 2 &gt;=4 -0.07272768</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 8 0.25 8 &lt;=0.5 0.02436854</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &lt;=2 1 2 &gt;=4 0.07054523</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H &lt;=2 2 8 &gt;=4 0.49475116</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 8 1 8 &gt;=4 0.81400616</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J &gt;=16 0.5 16 &gt;=4 1.06457646</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="va">y</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
@ -252,17 +251,17 @@
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Calculating mean AMR distance based on columns "amox", "cipr", "gent" and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "tobr"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C &lt;=2 0.025 0.5 4 -0.6609425 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 H &lt;=2 0.025 2 2 -0.4920944 0.1688482</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 I &gt;=16 0.0625 0.25 &lt;=1 -0.4283259 0.2326166</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 B &lt;=2 &gt;=2 1 &lt;=1 -0.2300449 0.4308977</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 G &lt;=2 &gt;=2 0.25 8 -0.1096818 0.5512607</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 A 4 0.25 1 &gt;=16 0.2679478 0.9288903</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 D 4 &gt;=2 4 &lt;=1 0.2703257 0.9312683</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 J 8 0.025 4 8 0.3276773 0.9886199</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 F &gt;=16 0.125 0.5 &gt;=16 0.3959389 1.0568815</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 E &gt;=16 0.025 4 &gt;=16 0.6591997 1.3201423</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C &lt;=2 1 2 &gt;=4 0.07054523 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 8 0.25 8 &lt;=0.5 0.02436854 0.04617669</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 A 4 0.125 2 &gt;=4 -0.07272768 0.14327291</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 G 8 0.0625 1 2 -0.30764224 0.37818747</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 I 8 0.125 0.5 2 -0.33800496 0.40855018</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 H &lt;=2 2 8 &gt;=4 0.49475116 0.42420593</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 E &lt;=2 1 2 &lt;=0.5 -0.47677206 0.54731729</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 D 8 1 8 &gt;=4 0.81400616 0.74346093</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 J &gt;=16 0.5 16 &gt;=4 1.06457646 0.99403123</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 F &lt;=2 &lt;=0.025 1 &lt;=0.5 -1.27310062 1.34364585</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -178,43 +178,42 @@
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1 0.001 16 &gt;=256 0.002 16 64 2 16 0.125 0.001 0.005</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 0.001 0.01 64 0.001 0.002 128 0.5 32 1 0.001 2 0.125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 0.01 64 0.5 &lt;=0.001 64 4 8 64 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.5 16 0.25 0.005 0.125 0.005 &lt;=0.001 4 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.002 0.01 0.125 4 64 0.002 &gt;=128 </span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 31 40 42 6 12 20 44 35 47 47 49 11 41 10 9 7 35 32 48 13 28 15 37 35 28</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 19 48 50 43 37 6 35 42 37 19 33 47 50 45 48 44 47 26 15 23 42 15 38 30 38</span>
<span class="r-in"><span><span class="fu">random_rsi</span><span class="op">(</span><span class="fl">25</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'rsi'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I S I S S I I I I R R I I R R R S S I R R I R R I</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I R S I I S S I S R R S I S I I R R I S S R S I I</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
<span class="r-in"><span><span class="co"># make the random generation more realistic by setting a bug and/or drug:</span></span></span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 0.0625-64</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 1 32 64 &lt;=0.001 2 0.025 8 32 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 32 0.002 0.005 2 0.025 0.005 0.025 128 32 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 32 8 128 0.005 1 0.01 0.5 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.005 0.5 1 0.005 2 0.01 16 0.25 128 0.002 8 0.025</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 32 16 16 0.001 4 0.005 16 0.125 0.25 8 0.5 64 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 32 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-16</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=0.5 &gt;=16 1 4 &gt;=16 &gt;=16 2 &gt;=16 8 1 &lt;=0.5 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] &gt;=16 4 2 2 8 2 2 4 1 8 &gt;=16 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 16 &lt;=1 2 16 &lt;=1 &gt;=64 &lt;=1 32 4 &lt;=1 2 16 2 2 &gt;=64</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [16] &gt;=64 2 8 32 &gt;=64 8 8 4 &lt;=1 16 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Streptococcus pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-4</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=0.025 &lt;=0.025 0.5 0.125 &lt;=0.025 &lt;=0.025 16 0.5 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 8 1 2 16 16 &lt;=0.025 16 0.5 &lt;=0.025</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.25 4 2 0.125 1 1 &lt;=0.025</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1 8 2 &lt;=0.125 0.5 &lt;=0.125 0.5 1 0.5 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.5 8 &lt;=0.125 2 1 2 0.25 1 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 2 2 1 0.25 0.5 8 0.25 </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 8-50</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 34 18 36 49 44 12 50 42 50 50 28 17 42 40 16 44 24 44 48 10 15 49 49 16 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 14 49 37 14 42 20 48 28 49 28 47 21 35 34 35 36 49 31 18 39 25 50 23 32 26</span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"ampicillin"</span><span class="op">)</span> <span class="co"># range 11-17</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 17 14 16 16 17 16 16 16 17 13 14 11 15 11 17 12 13 13 14 14 17 16 11 14 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 11 11 14 12 16 13 15 11 12 14 14 13 13 12 16 14 11 12 11 11 13 15 17 13 16</span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Streptococcus pneumoniae"</span>, <span class="st">"ampicillin"</span><span class="op">)</span> <span class="co"># range 12-27</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 18 17 15 19 25 23 27 23 15 22 23 17 16 27 22 21 20 19 17 20 25 15 26 24 23</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 22 23 20 17 18 15 20 26 22 26 16 23 23 27 20 18 18 17 25 27 27 15 19 19 19</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>

View File

@ -166,7 +166,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">skewness</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Uniform.html" class="external-link">runif</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.0329977</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.0958419</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

File diff suppressed because one or more lines are too long