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

Built site for AMR: 1.8.2.9047@d2edcf5

This commit is contained in:
github-actions 2022-11-12 11:17:17 +00:00
parent 68a0b3f94a
commit 6fd5ff2a24
36 changed files with 486 additions and 485 deletions

View File

@ -395,21 +395,43 @@ data set:</p>
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2017-08-16</td> <td align="center">2012-03-28</td>
<td align="center">S1</td> <td align="center">G1</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">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2010-09-12</td>
<td align="center">E1</td>
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">Escherichia coli</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">R</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2015-07-10</td>
<td align="center">N9</td>
<td align="center">Hospital D</td>
<td align="center">Klebsiella 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">F</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2014-12-04</td> <td align="center">2016-02-13</td>
<td align="center">J1</td> <td align="center">B8</td>
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">Escherichia coli</td> <td align="center">Staphylococcus aureus</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -417,48 +439,26 @@ data set:</p>
<td align="center">M</td> <td align="center">M</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">2012-07-21</td> <td align="center">2016-12-26</td>
<td align="center">R6</td> <td align="center">X3</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2012-11-26</td>
<td align="center">K8</td>
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td> <td align="center">Staphylococcus aureus</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="odd">
<td align="center">2011-07-23</td>
<td align="center">Z2</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2016-05-31</td> <td align="center">2014-04-05</td>
<td align="center">S7</td> <td align="center">K5</td>
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">Escherichia coli</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">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">M</td>
<td align="center">F</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -494,16 +494,16 @@ Longest: 1</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">M</td> <td align="left">M</td>
<td align="right">10,563</td> <td align="right">10,517</td>
<td align="right">52.82%</td> <td align="right">52.59%</td>
<td align="right">10,563</td> <td align="right">10,517</td>
<td align="right">52.82%</td> <td align="right">52.59%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">F</td> <td align="left">F</td>
<td align="right">9,437</td> <td align="right">9,483</td>
<td align="right">47.19%</td> <td align="right">47.42%</td>
<td align="right">20,000</td> <td align="right">20,000</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>
@ -616,10 +616,10 @@ takes into account the antimicrobial susceptibility test results using
<span><span class="co"># Basing inclusion on all antimicrobial results, using a points threshold of</span></span> <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"># 2</span></span>
<span><span class="co"># Including isolates from ICU.</span></span> <span><span class="co"># Including isolates from ICU.</span></span>
<span><span class="co"># =&gt; Found 10,633 'phenotype-based' first isolates (53.2% of total where a</span></span> <span><span class="co"># =&gt; Found 10,603 'phenotype-based' first isolates (53.0% of total where a</span></span>
<span><span class="co"># microbial ID was available)</span></span></code></pre></div> <span><span class="co"># microbial ID was available)</span></span></code></pre></div>
<p>So only 53.2% is suitable for resistance analysis! We can now filter <p>So only 53% is suitable for resistance analysis! We can now filter on
on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter()</a></code> function, also from the 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> <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<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> <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>
@ -629,7 +629,7 @@ on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html"
<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> <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="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> <span><span class="co"># Including isolates from ICU.</span></span></code></pre></div>
<p>So we end up with 10,633 isolates for analysis. Now our data looks <p>So we end up with 10,603 isolates for analysis. Now our data looks
like:</p> like:</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r"> <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> <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>
@ -646,8 +646,8 @@ like:</p>
<col width="3%"> <col width="3%">
<col width="6%"> <col width="6%">
<col width="11%"> <col width="11%">
<col width="12%"> <col width="10%">
<col width="7%"> <col width="9%">
<col width="5%"> <col width="5%">
</colgroup> </colgroup>
<thead><tr class="header"> <thead><tr class="header">
@ -669,92 +669,60 @@ like:</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="center">2012-07-21</td> <td align="center">2015-07-10</td>
<td align="center">R6</td> <td align="center">N9</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">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="even">
<td align="left">4</td>
<td align="center">2012-11-26</td>
<td align="center">K8</td>
<td align="center">Hospital A</td>
<td align="center">B_STPHY_AURS</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-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="center">2011-07-23</td>
<td align="center">Z2</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="even">
<td align="left">6</td>
<td align="center">2016-05-31</td>
<td align="center">S7</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">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">7</td>
<td align="center">2011-07-29</td>
<td align="center">C9</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">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">14</td>
<td align="center">2016-07-22</td>
<td align="center">N8</td>
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">8</td>
<td align="center">2013-12-26</td>
<td align="center">K2</td>
<td align="center">Hospital D</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td>
<td align="center">I</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">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">11</td>
<td align="center">2017-12-04</td>
<td align="center">B10</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">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">12</td>
<td align="center">2010-03-06</td>
<td align="center">X9</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">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
@ -763,6 +731,38 @@ like:</p>
<td align="center">coli</td> <td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd">
<td align="left">14</td>
<td align="center">2017-11-16</td>
<td align="center">K5</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">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">15</td>
<td align="center">2012-05-28</td>
<td align="center">X4</td>
<td align="center">Hospital B</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</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-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
</tbody> </tbody>
</table> </table>
<p>Time for the analysis!</p> <p>Time for the analysis!</p>
@ -796,8 +796,8 @@ readable:</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://msberends.github.io/cleaner/reference/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> <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://msberends.github.io/cleaner/reference/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><strong>Frequency table</strong></p>
<p>Class: character<br> <p>Class: character<br>
Length: 10,633<br> Length: 10,603<br>
Available: 10,633 (100%, NA: 0 = 0%)<br> Available: 10,603 (100%, NA: 0 = 0%)<br>
Unique: 4</p> Unique: 4</p>
<p>Shortest: 16<br> <p>Shortest: 16<br>
Longest: 24</p> Longest: 24</p>
@ -822,33 +822,33 @@ Longest: 24</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">Escherichia coli</td> <td align="left">Escherichia coli</td>
<td align="right">4,624</td> <td align="right">4,605</td>
<td align="right">43.49%</td> <td align="right">43.43%</td>
<td align="right">4,624</td> <td align="right">4,605</td>
<td align="right">43.49%</td> <td align="right">43.43%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">Staphylococcus aureus</td> <td align="left">Staphylococcus aureus</td>
<td align="right">2,730</td> <td align="right">2,704</td>
<td align="right">25.67%</td> <td align="right">25.50%</td>
<td align="right">7,354</td> <td align="right">7,309</td>
<td align="right">69.16%</td> <td align="right">68.93%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td> <td align="left">Streptococcus pneumoniae</td>
<td align="right">2,082</td> <td align="right">2,080</td>
<td align="right">19.58%</td> <td align="right">19.62%</td>
<td align="right">9,436</td> <td align="right">9,389</td>
<td align="right">88.74%</td> <td align="right">88.55%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">4</td> <td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td> <td align="left">Klebsiella pneumoniae</td>
<td align="right">1,197</td> <td align="right">1,214</td>
<td align="right">11.26%</td> <td align="right">11.45%</td>
<td align="right">10,633</td> <td align="right">10,603</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>
</tbody> </tbody>
@ -869,14 +869,14 @@ antibiotic class they are in:</p>
<col width="9%"> <col width="9%">
<col width="9%"> <col width="9%">
<col width="9%"> <col width="9%">
<col width="11%"> <col width="10%">
<col width="3%"> <col width="3%">
<col width="3%"> <col width="3%">
<col width="3%"> <col width="3%">
<col width="3%"> <col width="3%">
<col width="6%"> <col width="6%">
<col width="11%"> <col width="11%">
<col width="11%"> <col width="12%">
<col width="9%"> <col width="9%">
<col width="5%"> <col width="5%">
</colgroup> </colgroup>
@ -897,92 +897,92 @@ antibiotic class they are in:</p>
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2012-12-19</td> <td align="center">2012-05-28</td>
<td align="center">S3</td> <td align="center">X4</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">R</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-04-29</td>
<td align="center">E8</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">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="odd">
<td align="center">2014-11-08</td>
<td align="center">R2</td>
<td align="center">Hospital B</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">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">2012-09-13</td>
<td align="center">W3</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">R</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">2017-11-23</td>
<td align="center">F9</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">TRUE</td>
</tr>
<tr class="even">
<td align="center">2014-07-26</td>
<td align="center">R5</td>
<td align="center">Hospital C</td>
<td align="center">B_KLBSL_PNMN</td> <td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2013-02-21</td>
<td align="center">Q4</td>
<td align="center">Hospital A</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">R</td> <td align="center">R</td>
<td align="center">F</td> <td align="center">F</td>
<td align="center">Gram-negative</td> <td align="center">Gram-negative</td>
<td align="center">Klebsiella</td> <td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2014-12-17</td>
<td align="center">V4</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">R</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="center">2012-01-20</td>
<td align="center">E6</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">S</td>
<td align="center">R</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="center">2014-01-15</td>
<td align="center">Y1</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">R</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="center">2015-02-24</td>
<td align="center">I1</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">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td> <td align="center">pneumoniae</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
@ -1009,50 +1009,50 @@ different bug/drug combinations, you can use the
<tr class="odd"> <tr class="odd">
<td align="center">E. coli</td> <td align="center">E. coli</td>
<td align="center">AMX</td> <td align="center">AMX</td>
<td align="center">2175</td> <td align="center">2153</td>
<td align="center">124</td> <td align="center">133</td>
<td align="center">2325</td> <td align="center">2319</td>
<td align="center">4624</td> <td align="center">4605</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">E. coli</td> <td align="center">E. coli</td>
<td align="center">AMC</td> <td align="center">AMC</td>
<td align="center">3402</td> <td align="center">3353</td>
<td align="center">145</td> <td align="center">146</td>
<td align="center">1077</td> <td align="center">1106</td>
<td align="center">4624</td> <td align="center">4605</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">E. coli</td> <td align="center">E. coli</td>
<td align="center">CIP</td> <td align="center">CIP</td>
<td align="center">3385</td> <td align="center">3357</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">1239</td> <td align="center">1248</td>
<td align="center">4624</td> <td align="center">4605</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">E. coli</td> <td align="center">E. coli</td>
<td align="center">GEN</td> <td align="center">GEN</td>
<td align="center">4046</td> <td align="center">4032</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">578</td> <td align="center">573</td>
<td align="center">4624</td> <td align="center">4605</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">K. pneumoniae</td> <td align="center">K. pneumoniae</td>
<td align="center">AMX</td> <td align="center">AMX</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">1197</td> <td align="center">1214</td>
<td align="center">1197</td> <td align="center">1214</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">K. pneumoniae</td> <td align="center">K. pneumoniae</td>
<td align="center">AMC</td> <td align="center">AMC</td>
<td align="center">922</td> <td align="center">938</td>
<td align="center">67</td> <td align="center">48</td>
<td align="center">208</td> <td align="center">228</td>
<td align="center">1197</td> <td align="center">1214</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1075,34 +1075,34 @@ different bug/drug combinations, you can use the
<tr class="odd"> <tr class="odd">
<td align="center">E. coli</td> <td align="center">E. coli</td>
<td align="center">GEN</td> <td align="center">GEN</td>
<td align="center">4046</td> <td align="center">4032</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">578</td> <td align="center">573</td>
<td align="center">4624</td> <td align="center">4605</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">K. pneumoniae</td> <td align="center">K. pneumoniae</td>
<td align="center">GEN</td> <td align="center">GEN</td>
<td align="center">1060</td> <td align="center">1077</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">137</td> <td align="center">137</td>
<td align="center">1197</td> <td align="center">1214</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">S. aureus</td> <td align="center">S. aureus</td>
<td align="center">GEN</td> <td align="center">GEN</td>
<td align="center">2411</td> <td align="center">2407</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">319</td> <td align="center">297</td>
<td align="center">2730</td> <td align="center">2704</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">S. pneumoniae</td> <td align="center">S. pneumoniae</td>
<td align="center">GEN</td> <td align="center">GEN</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">0</td> <td align="center">0</td>
<td align="center">2082</td> <td align="center">2080</td>
<td align="center">2082</td> <td align="center">2080</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1134,7 +1134,7 @@ I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equa
own:</p> own:</p>
<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r"> <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> <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.5444371</span></span></code></pre></div> <span><span class="co"># [1] 0.5472036</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 <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> <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"> <div class="sourceCode" id="cb27"><pre class="downlit sourceCode r">
@ -1149,19 +1149,19 @@ own:</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.5425466</td> <td align="center">0.5600486</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.5360493</td> <td align="center">0.5391692</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.5492327</td> <td align="center">0.5552826</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.5585458</td> <td align="center">0.5345403</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1186,23 +1186,23 @@ all isolates available for every group (i.e. values S, I or R):</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.5425466</td> <td align="center">0.5600486</td>
<td align="center">3220</td> <td align="center">3289</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.5360493</td> <td align="center">0.5391692</td>
<td align="center">3731</td> <td align="center">3587</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.5492327</td> <td align="center">0.5552826</td>
<td align="center">1564</td> <td align="center">1628</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.5585458</td> <td align="center">0.5345403</td>
<td align="center">2118</td> <td align="center">2099</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1227,27 +1227,27 @@ therapies very easily:</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Escherichia</td> <td align="center">Escherichia</td>
<td align="center">0.7670848</td> <td align="center">0.7598263</td>
<td align="center">0.8750000</td> <td align="center">0.8755700</td>
<td align="center">0.9764273</td> <td align="center">0.9774159</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Klebsiella</td> <td align="center">Klebsiella</td>
<td align="center">0.8262322</td> <td align="center">0.8121911</td>
<td align="center">0.8855472</td> <td align="center">0.8871499</td>
<td align="center">0.9791145</td> <td align="center">0.9728171</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Staphylococcus</td> <td align="center">Staphylococcus</td>
<td align="center">0.7908425</td> <td align="center">0.7917899</td>
<td align="center">0.8831502</td> <td align="center">0.8901627</td>
<td align="center">0.9754579</td> <td align="center">0.9822485</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Streptococcus</td> <td align="center">Streptococcus</td>
<td align="center">0.5317003</td> <td align="center">0.5423077</td>
<td align="center">0.0000000</td> <td align="center">0.0000000</td>
<td align="center">0.5317003</td> <td align="center">0.5423077</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1275,23 +1275,23 @@ classes, use a antibiotic class selector such as
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="left">Hospital A</td> <td align="left">Hospital A</td>
<td align="right">54.3%</td> <td align="right">56.0%</td>
<td align="right">25.2%</td> <td align="right">28.0%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">Hospital B</td> <td align="left">Hospital B</td>
<td align="right">53.6%</td> <td align="right">53.9%</td>
<td align="right">26.7%</td> <td align="right">27.0%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">Hospital C</td> <td align="left">Hospital C</td>
<td align="right">54.9%</td> <td align="right">55.5%</td>
<td align="right">25.9%</td> <td align="right">25.3%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">Hospital D</td> <td align="left">Hospital D</td>
<td align="right">55.9%</td> <td align="right">53.5%</td>
<td align="right">29.3%</td> <td align="right">26.1%</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1407,16 +1407,18 @@ classes) <code>&lt;mic&gt;</code> and <code>&lt;disk&gt;</code>:</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> <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="va">mic_values</span></span>
<span><span class="co"># Class 'mic'</span></span> <span><span class="co"># Class 'mic'</span></span>
<span><span class="co"># [1] 0.001 0.5 0.002 4 0.025 8 4 32 0.025 32 </span></span> <span><span class="co"># [1] 32 &lt;=0.001 16 16 0.5 0.5 0.0625 4 0.25 </span></span>
<span><span class="co"># [11] &gt;=256 0.001 0.5 0.5 0.002 0.002 0.025 16 1 0.025 </span></span> <span><span class="co"># [10] 0.01 128 256 0.01 &lt;=0.001 0.25 0.25 128 256 </span></span>
<span><span class="co"># [21] &gt;=256 0.0625 0.002 0.5 0.0625 4 1 0.001 16 &gt;=256 </span></span> <span><span class="co"># [19] 8 64 256 256 1 32 0.0625 0.005 4 </span></span>
<span><span class="co"># [31] 0.005 0.002 0.002 &gt;=256 0.005 0.025 0.5 8 0.125 0.125 </span></span> <span><span class="co"># [28] 0.005 0.125 0.025 0.125 8 64 &lt;=0.001 0.5 0.025 </span></span>
<span><span class="co"># [41] 0.005 0.005 &gt;=256 4 0.005 0.001 0.025 0.01 0.01 128 </span></span> <span><span class="co"># [37] 0.002 0.5 0.002 4 &lt;=0.001 0.25 1 0.125 4 </span></span>
<span><span class="co"># [51] 0.001 0.5 0.005 32 64 8 0.005 8 0.001 32 </span></span> <span><span class="co"># [46] 128 256 0.01 0.002 0.01 32 32 0.005 4 </span></span>
<span><span class="co"># [61] 0.5 128 0.001 2 32 0.125 16 16 8 0.002 </span></span> <span><span class="co"># [55] 0.0625 256 0.25 2 32 0.01 &lt;=0.001 4 0.5 </span></span>
<span><span class="co"># [71] 0.25 4 0.25 128 0.002 0.5 0.25 0.025 0.025 4 </span></span> <span><span class="co"># [64] 8 0.125 0.005 &lt;=0.001 64 1 0.5 16 1 </span></span>
<span><span class="co"># [81] &gt;=256 8 0.002 1 0.001 64 0.25 0.5 0.005 16 </span></span> <span><span class="co"># [73] 2 0.005 0.25 64 32 16 &lt;=0.001 128 0.025 </span></span>
<span><span class="co"># [91] 0.025 0.25 0.025 1 2 2 &gt;=256 1 0.5 0.125</span></span></code></pre></div> <span><span class="co"># [82] 4 256 16 0.125 2 0.005 &lt;=0.001 0.0625 0.005 </span></span>
<span><span class="co"># [91] 0.5 2 128 0.5 2 16 0.002 &lt;=0.001 0.125 </span></span>
<span><span class="co"># [100] 0.002</span></span></code></pre></div>
<div class="sourceCode" id="cb37"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb37"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span> <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> <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>
@ -1450,10 +1452,10 @@ plotting:</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> <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="va">disk_values</span></span>
<span><span class="co"># Class 'disk'</span></span> <span><span class="co"># Class 'disk'</span></span>
<span><span class="co"># [1] 30 31 30 24 26 25 23 24 17 22 30 27 20 19 24 21 21 20 21 26 22 24 18 30 17</span></span> <span><span class="co"># [1] 20 26 25 18 21 30 25 24 29 29 18 31 24 22 19 21 21 30 18 22 27 20 25 19 28</span></span>
<span><span class="co"># [26] 28 30 22 27 27 31 19 24 27 23 18 30 21 20 18 19 21 26 18 18 20 17 27 30 25</span></span> <span><span class="co"># [26] 28 29 26 17 24 20 30 22 30 24 18 25 27 29 29 22 28 18 29 28 21 29 27 19 29</span></span>
<span><span class="co"># [51] 31 21 23 23 27 19 24 30 25 22 31 19 26 26 24 27 19 17 25 20 28 28 26 24 19</span></span> <span><span class="co"># [51] 21 17 17 23 26 22 27 30 29 20 26 18 18 17 24 21 23 25 26 17 24 22 18 31 29</span></span>
<span><span class="co"># [76] 22 18 30 23 27 27 21 28 21 24 23 17 23 20 24 31 17 21 17 19 26 18 29 20 25</span></span></code></pre></div> <span><span class="co"># [76] 29 21 24 27 22 28 26 25 19 17 23 24 28 31 18 30 30 25 22 22 31 25 31 24 26</span></span></code></pre></div>
<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb43"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span> <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> <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: 38 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 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: 38 KiB

After

Width:  |  Height:  |  Size: 36 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: 48 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

@ -370,19 +370,19 @@ names or codes, this would have worked exactly the same way:</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r"> <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> <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"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
<span><span class="co"># 1 R S R S R R</span></span> <span><span class="co"># 1 I I I S S R</span></span>
<span><span class="co"># 2 R I R R R I</span></span> <span><span class="co"># 2 R S S S I I</span></span>
<span><span class="co"># 3 I R S I S R</span></span> <span><span class="co"># 3 S R R R S R</span></span>
<span><span class="co"># 4 I I I R I S</span></span> <span><span class="co"># 4 S I R S I I</span></span>
<span><span class="co"># 5 R R S R I S</span></span> <span><span class="co"># 5 S S S I S R</span></span>
<span><span class="co"># 6 S S R R R I</span></span> <span><span class="co"># 6 I S R S I I</span></span>
<span><span class="co"># kanamycin</span></span> <span><span class="co"># kanamycin</span></span>
<span><span class="co"># 1 I</span></span> <span><span class="co"># 1 I</span></span>
<span><span class="co"># 2 S</span></span> <span><span class="co"># 2 S</span></span>
<span><span class="co"># 3 S</span></span> <span><span class="co"># 3 R</span></span>
<span><span class="co"># 4 S</span></span> <span><span class="co"># 4 I</span></span>
<span><span class="co"># 5 S</span></span> <span><span class="co"># 5 R</span></span>
<span><span class="co"># 6 R</span></span></code></pre></div> <span><span class="co"># 6 I</span></span></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can <p>We can now add the interpretation of MDR-TB to our data set. You can
use:</p> use:</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
@ -423,40 +423,40 @@ Unique: 5</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">Mono-resistant</td> <td align="left">Mono-resistant</td>
<td align="right">3231</td> <td align="right">3140</td>
<td align="right">64.62%</td> <td align="right">62.80%</td>
<td align="right">3231</td> <td align="right">3140</td>
<td align="right">64.62%</td> <td align="right">62.80%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">Negative</td> <td align="left">Negative</td>
<td align="right">961</td> <td align="right">1031</td>
<td align="right">19.22%</td> <td align="right">20.62%</td>
<td align="right">4192</td> <td align="right">4171</td>
<td align="right">83.84%</td> <td align="right">83.42%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="left">Multi-drug-resistant</td> <td align="left">Multi-drug-resistant</td>
<td align="right">445</td> <td align="right">463</td>
<td align="right">8.90%</td> <td align="right">9.26%</td>
<td align="right">4637</td> <td align="right">4634</td>
<td align="right">92.74%</td> <td align="right">92.68%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">4</td> <td align="left">4</td>
<td align="left">Poly-resistant</td> <td align="left">Poly-resistant</td>
<td align="right">250</td> <td align="right">252</td>
<td align="right">5.00%</td> <td align="right">5.04%</td>
<td align="right">4887</td> <td align="right">4886</td>
<td align="right">97.74%</td> <td align="right">97.72%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">5</td> <td align="left">5</td>
<td align="left">Extensively drug-resistant</td> <td align="left">Extensively drug-resistant</td>
<td align="right">113</td> <td align="right">114</td>
<td align="right">2.26%</td> <td align="right">2.28%</td>
<td align="right">5000</td> <td align="right">5000</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>

View File

@ -191,7 +191,7 @@ column names:<br><em>mo</em>, <em>fullname</em>, <em>status</em>, <em>kingdom</e
<em>gbif_renamed_to</em>, <em>prevalence</em> and <em>snomed</em>.</p> <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 <p>This data set is in R available as <code>microorganisms</code>, after
you load the <code>AMR</code> package.</p> you load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 29 October 2022 12:15:23 UTC. Find more info
about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -490,7 +490,7 @@ column names:<br><em>ab</em>, <em>cid</em>, <em>name</em>, <em>group</em>, <em>a
<em>iv_ddd</em>, <em>iv_units</em> and <em>loinc</em>.</p> <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 <p>This data set is in R available as <code>antibiotics</code>, after
you load the <code>AMR</code> package.</p> you load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 30 October 2022 20:05:46 UTC. Find more info
about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -687,7 +687,7 @@ column names:<br><em>atc</em>, <em>cid</em>, <em>name</em>, <em>atc_group</em>,
<em>iv_ddd</em> and <em>iv_units</em>.</p> <em>iv_ddd</em> and <em>iv_units</em>.</p>
<p>This data set is in R available as <code>antivirals</code>, after you <p>This data set is in R available as <code>antivirals</code>, after you
load the <code>AMR</code> package.</p> load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 27 August 2022 18:49:37 UTC. Find more info
about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -847,7 +847,7 @@ column names:<br><em>guideline</em>, <em>method</em>, <em>site</em>, <em>mo</em>
<em>breakpoint_S</em>, <em>breakpoint_R</em> and <em>uti</em>.</p> <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>, <p>This data set is in R available as <code>rsi_translation</code>,
after you load the <code>AMR</code> package.</p> after you load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 29 October 2022 17:01:23 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> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -1020,7 +1020,7 @@ Resistance<a class="anchor" aria-label="anchor" href="#intrinsic_resistant-intri
column names:<br><em>mo</em> and <em>ab</em>.</p> column names:<br><em>mo</em> and <em>ab</em>.</p>
<p>This data set is in R available as <code>intrinsic_resistant</code>, <p>This data set is in R available as <code>intrinsic_resistant</code>,
after you load the <code>AMR</code> package.</p> after you load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 31 October 2022 10:19:06 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> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -1308,7 +1308,7 @@ column names:<br><em>ab</em>, <em>name</em>, <em>type</em>, <em>dose</em>,
<em>original_txt</em> and <em>eucast_version</em>.</p> <em>original_txt</em> and <em>eucast_version</em>.</p>
<p>This data set is in R available as <code>dosage</code>, after you <p>This data set is in R available as <code>dosage</code>, after you
load the <code>AMR</code> package.</p> load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 30 October 2022 20:05:46 UTC. Find more info
about the structure of this data set <a href="https://msberends.github.io/AMR/reference/dosage.html">here</a>.</p> 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> <p><strong>Direct download links:</strong></p>
<ul> <ul>
@ -1458,7 +1458,7 @@ column names:<br><em>date</em>, <em>patient</em>, <em>age</em>, <em>gender</em>,
<em>MUP</em> and <em>RIF</em>.</p> <em>MUP</em> and <em>RIF</em>.</p>
<p>This data set is in R available as <code>example_isolates</code>, <p>This data set is in R available as <code>example_isolates</code>,
after you load the <code>AMR</code> package.</p> after you load the <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 27 August 2022 18:49:37 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> 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"> <div class="section level3">
<h3 id="source-6">Source<a class="anchor" aria-label="anchor" href="#source-6"></a> <h3 id="source-6">Source<a class="anchor" aria-label="anchor" href="#source-6"></a>
@ -1871,7 +1871,7 @@ column names:<br><em>patient_id</em>, <em>hospital</em>, <em>date</em>,
<p>This data set is in R available as <p>This data set is in R available as
<code>example_isolates_unclean</code>, after you load the <code>example_isolates_unclean</code>, after you load the
<code>AMR</code> package.</p> <code>AMR</code> package.</p>
<p>It was last updated on 12 November 2022 08:46:26 UTC. Find more info <p>It was last updated on 27 August 2022 18:49:37 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> 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"> <div class="section level3">
<h3 id="source-7">Source<a class="anchor" aria-label="anchor" href="#source-7"></a> <h3 id="source-7">Source<a class="anchor" aria-label="anchor" href="#source-7"></a>

View File

@ -11,7 +11,7 @@ articles:
datasets: datasets.html datasets: datasets.html
resistance_predict: resistance_predict.html resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html welcome_to_AMR: welcome_to_AMR.html
last_built: 2022-11-12T08:48Z last_built: 2022-11-12T11:14Z
urls: urls:
reference: https://msberends.github.io/AMR/reference reference: https://msberends.github.io/AMR/reference
article: https://msberends.github.io/AMR/articles 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: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -190,16 +190,16 @@
<span class="r-in"><span></span></span> <span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">df</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> birth_date age age_exact age_at_y2k</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1984-06-05 38 38.43836 15</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 1 1953-11-27 68 68.95890 46</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1940-05-20 82 82.48219 59</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 2 1960-04-11 62 62.58904 39</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1961-12-07 60 60.93151 38</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 3 1973-06-04 49 49.44110 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1967-12-24 54 54.88493 32</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 4 1977-12-02 44 44.94521 22</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1992-10-19 30 30.06575 7</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 5 1970-05-13 52 52.50137 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1950-01-21 72 72.80822 49</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 6 1976-05-14 46 46.49863 23</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1935-09-14 87 87.16164 64</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 7 1962-08-03 60 60.27671 37</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1981-08-01 41 41.28219 18</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 8 1939-08-15 83 83.24384 60</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1932-09-05 90 90.18630 67</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 9 1984-10-15 38 38.07671 15</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1954-05-16 68 68.49315 45</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 10 1932-12-30 89 89.86849 67</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -496,16 +496,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> <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> 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: #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-11-12 <span style="color: #949494;">08:49:16</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;"> 1</span> 2022-11-12 <span style="color: #949494;">11:14:27</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-11-12 <span style="color: #949494;">08:49:16</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;"> 2</span> 2022-11-12 <span style="color: #949494;">11:14:27</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-11-12 <span style="color: #949494;">08:49:16</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;"> 3</span> 2022-11-12 <span style="color: #949494;">11:14:28</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-11-12 <span style="color: #949494;">08:49:17</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;"> 4</span> 2022-11-12 <span style="color: #949494;">11:14:28</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-11-12 <span style="color: #949494;">08:49:17</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;"> 5</span> 2022-11-12 <span style="color: #949494;">11:14:28</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-11-12 <span style="color: #949494;">08:49:17</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;"> 6</span> 2022-11-12 <span style="color: #949494;">11:14:29</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-11-12 <span style="color: #949494;">08:49:18</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-11-12 <span style="color: #949494;">11:14:29</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-11-12 <span style="color: #949494;">08:49:18</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;"> 8</span> 2022-11-12 <span style="color: #949494;">11:14:29</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-11-12 <span style="color: #949494;">08:49:18</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;"> 9</span> 2022-11-12 <span style="color: #949494;">11:14:30</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-11-12 <span style="color: #949494;">08:49:18</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;">10</span> 2022-11-12 <span style="color: #949494;">11:14:30</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;"># … 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;"># 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> <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,41 +177,39 @@
<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 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></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-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] 45 29 45 57 14 40 18 59 22 11 17 11 1 44 60 54 15 38 11 21 17 55 46 57 34</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 47 62 48 9 37 56 39 32 57 43 62 17 55 10 54 45 14 28 42 56 60 34 7 29 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 53 5 57 3 28 45 20 15 38 16 60 20 25 24 28 63 10 4 9 19 17 56 34 19 59</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [26] 44 55 6 55 36 5 43 8 32 42 31 58 8 33 1 50 27 20 13 2 60 15 59 11 59</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 8 38 62 51 62 7 36 57 14 46 54 58 44 37 59 57 7 6 46 9 10 8 60 54 17</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [51] 56 58 6 41 56 47 21 11 42 59 1 24 46 38 30 4 41 11 24 31 53 36 11 9 13</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 21 5 49 50 8 9 39 8 52 20 30 3 14 54 13 36 47 2 59 18 56 18 17 41 61</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [76] 51 20 13 40 21 44 22 36 50 23 2 52 18 54 59 25 62 52 59 35 49 41 24 17 62</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [101] 58 22 53 26 43 29 53 42 25 53 61 37 2 1 55 62 61 32 27 39 12 7 62 10 30</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [101] 45 3 19 56 16 44 6 53 16 46 47 60 28 1 54 17 27 58 10 29 27 54 43 27 54</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [126] 55 9 18 25 41 7 11 2 58 31 48 56 5 58 5 61 63 20 59 34 15 44 55 60 37</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [126] 51 9 55 8 33 22 19 61 47 37 60 62 25 32 49 13 8 46 1 31 8 2 13 5 37</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [151] 5 15 27 14 33 25 38 55 55 60 7 48 2 32 54 12 54 22 51 42 52 36 31 56 45</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [151] 12 55 32 25 13 46 19 48 47 61 21 1 1 59 4 8 19 49 40 32 8 60 13 10 27</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [176] 52 11 37 42 1 4 3 43 42 16 52 25 49 52 17 5 23 31 20 21 26 35 45 49 28</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [176] 40 38 26 20 4 8 15 22 56 58 16 8 55 14 10 29 12 61 11 48 42 18 46 60 20</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-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 FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [13] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [25] FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] TRUE TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [85] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [109] TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [109] TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [121] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [133] FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [133] FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [145] FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [145] FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [157] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [157] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [169] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [169] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [181] FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE TRUE TRUE FALSE TRUE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [181] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [193] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [193] FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE</span>
<span class="r-in"><span></span></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="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-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: 3 × 46</span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 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> 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: #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-07-30 218912 76 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-07-23 F35553 51 M ICU B_STPHY_AURS R NA S R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</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;">3</span> 2002-07-15 C42193 84 M ICU B_STPHY_HMNS R NA R R </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;"># … 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;"># 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> <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>
@ -247,16 +245,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> <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> 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: #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> 255339 2013-07-22 C FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> A97263 2013-11-23 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 942999 2009-02-17 C FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 3D2C93 2017-12-13 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 963927 2013-07-04 B FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 919B60 2013-12-31 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 7D5503 2016-05-30 B TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> EB1709 2003-12-27 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 990867 2005-08-16 B FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 394307 2011-02-24 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> C04744 2012-04-10 B FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 964129 2016-06-17 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 14D826 2006-09-14 A FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 13DF24 2011-08-14 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> B77047 2016-12-03 C FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 451000 2009-08-29 B FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 005088 2007-08-22 A FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> C34980 2016-06-28 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> D65308 2004-11-03 C FALSE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 4C9760 2012-09-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-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="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> <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>
@ -268,19 +266,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-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;"># A tibble: 200 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [184]</span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [177]</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> 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: #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 2013-07-22 255339 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2013-11-23 A97263 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2009-02-17 942999 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2017-12-13 3D2C93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2013-07-04 963927 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2013-12-31 919B60 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2016-05-30 7D5503 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2003-12-27 EB1709 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2005-08-16 990867 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2011-02-24 394307 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2012-04-10 C04744 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2016-06-17 964129 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2006-09-14 14D826 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2011-08-14 13DF24 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2016-12-03 B77047 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2009-08-29 451000 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2007-08-22 005088 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2016-06-28 C34980 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2004-11-03 D65308 1 TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2012-09-06 4C9760 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-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="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> <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>
@ -295,9 +293,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> <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> 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: #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 120 14 54 74</span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 105 15 51 69</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 54 13 37 46</span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 60 12 36 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 10 7 10 10</span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 12 6 11 12</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="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></span>
<span class="r-in"><span> <span class="co"># grouping on patients and microorganisms leads to the same</span></span></span> <span class="r-in"><span> <span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
@ -327,19 +325,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="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-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;"># 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 [194]</span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [188]</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> 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: #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> 255339 B_ESCHR_COLI Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> A97263 B_KLBSL_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 942999 B_STRPT_PNMN Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 3D2C93 B_STPHY_EPDR ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 963927 B_STRPT_PNMN Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 919B60 B_STPHY_AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 7D5503 B_STPHY_AURS Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> EB1709 B_STRPT_PNMN ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 990867 B_STPHY_AURS Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 394307 B_STPHY_AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> C04744 B_STRPT_EQNS Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 964129 B_SERRT_MRCS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 14D826 B_STPHY_CONS Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 13DF24 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> B77047 B_STPHY_AURS ICU TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 451000 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 005088 B_SLMNL_ENTR Clinical TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> C34980 B_STRPT_PYGN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> D65308 B_STPHY_EPDR ICU TRUE </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 4C9760 B_ESCHR_COLI 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-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> <span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div> </code></pre></div>

View File

@ -167,9 +167,9 @@
<div class="section level2"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <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] 2.969121</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.934002</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-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.03759822</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.03517118</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -195,11 +195,11 @@
<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> <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-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> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0625 32 128 0.01 0.125 8 256 &lt;=0.002 0.005 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1 0.005 2 0.125 0.002 0.5 0.0625 0.5 &lt;=0.001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 32 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.002 </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-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.5813297 0.8047503 1.1127681 -0.9885071 -0.4273208 0.4967325</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.04271494 -0.78781830 1.28219266 0.32428178 -1.10439062 0.80323722</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.2667770 -1.3461046 -1.1425160 0.8047503</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.08480407 0.80323722 -1.34386834 -1.10439062</span>
<span class="r-in"><span></span></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><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> <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>
@ -210,37 +210,37 @@
<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-in"><span><span class="va">y</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> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A &lt;=4 1 8 1</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.5 &lt;=1 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 16 0.5 4 4</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 8 &gt;=1 2 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C 8 0.5 1 1</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &gt;=16 0.5 2 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 16 &lt;=0.125 2 &lt;=0.5</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 4 D &gt;=16 0.25 2 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &lt;=4 0.25 2 2</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 5 E 8 0.25 2 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F 8 1 1 4</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 6 F 4 0.25 4 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G 16 &lt;=0.125 4 2</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 7 G &gt;=16 0.5 2 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H 8 &gt;=2 2 4</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 8 H 4 0.25 2 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I &gt;=32 &gt;=2 &gt;=16 &lt;=0.5</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 9 I 4 0.5 4 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J &lt;=4 &gt;=2 4 1</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 10 J 8 0.025 4 0.5</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-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> 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-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-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.029889016 0.523024563 -0.540292979 -0.632651576 -0.531264758</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.54407797 0.54766468 0.06869358 0.48271367 -0.27421097 -0.16444638</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [6] 0.045216758 -0.009037847 0.402397473 0.840490389 -0.067993008</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.18654471 -0.08832657 0.36434257 -0.57889732</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-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> 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-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-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> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D 16 &lt;=0.125 2 &lt;=0.5 -0.632651576</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 10 J 8 0.025 4 0.5 -0.57889732</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C 8 0.5 1 1 -0.540292979</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 1 A 4 0.5 &lt;=1 4 -0.54407797</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E &lt;=4 0.25 2 2 -0.531264758</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 5 E 8 0.25 2 1 -0.27421097</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J &lt;=4 &gt;=2 4 1 -0.067993008</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 6 F 4 0.25 4 1 -0.16444638</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A &lt;=4 1 8 1 -0.029889016</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 8 H 4 0.25 2 &gt;=16 -0.08832657</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G 16 &lt;=0.125 4 2 -0.009037847</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 3 C &gt;=16 0.5 2 0.5 0.06869358</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F 8 1 1 4 0.045216758</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 7 G &gt;=16 0.5 2 1 0.18654471</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H 8 &gt;=2 2 4 0.402397473</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 9 I 4 0.5 4 8 0.36434257</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 16 0.5 4 4 0.523024563</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 4 D &gt;=16 0.25 2 &gt;=16 0.48271367</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I &gt;=32 &gt;=2 &gt;=16 &lt;=0.5 0.840490389</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 2 B 8 &gt;=1 2 &gt;=16 0.54766468</span>
<span class="r-in"><span></span></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="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> <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>
@ -253,16 +253,16 @@
<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> 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-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> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C 8 0.5 1 1 -0.540292979 0.000000000</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 1 C &gt;=16 0.5 2 0.5 0.06869358 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 E &lt;=4 0.25 2 2 -0.531264758 0.009028221</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 2 G &gt;=16 0.5 2 1 0.18654471 0.1178511</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 D 16 &lt;=0.125 2 &lt;=0.5 -0.632651576 0.092358597</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 3 H 4 0.25 2 &gt;=16 -0.08832657 0.1570202</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 J &lt;=4 &gt;=2 4 1 -0.067993008 0.472299971</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 4 F 4 0.25 4 1 -0.16444638 0.2331400</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 A &lt;=4 1 8 1 -0.029889016 0.510403963</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 5 I 4 0.5 4 8 0.36434257 0.2956490</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 G 16 &lt;=0.125 4 2 -0.009037847 0.531255132</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 6 E 8 0.25 2 1 -0.27421097 0.3429046</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 F 8 1 1 4 0.045216758 0.585509737</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 7 D &gt;=16 0.25 2 &gt;=16 0.48271367 0.4140201</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H 8 &gt;=2 2 4 0.402397473 0.942690452</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 8 B 8 &gt;=1 2 &gt;=16 0.54766468 0.4789711</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 B 16 0.5 4 4 0.523024563 1.063317542</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 9 A 4 0.5 &lt;=1 4 -0.54407797 0.6127716</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 I &gt;=32 &gt;=2 &gt;=16 &lt;=0.5 0.840490389 1.380783368</span> <span class="r-out co"><span class="r-pr">#&gt;</span> 10 J 8 0.025 4 0.5 -0.57889732 0.6475909</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="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="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> <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: 27 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: 38 KiB

After

Width:  |  Height:  |  Size: 37 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: 37 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 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,42 +178,43 @@
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <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> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 8 &gt;=128 0.025 2 4 0.01 1 1 0.125 0.002 0.005 0.005</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 8 64 1 128 0.25 &lt;=0.001 0.25 0.01 0.025 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 16 0.001 0.025 2 0.25 0.5 0.025 1 4 32 0.125 8 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [10] 128 &lt;=0.001 128 &gt;=256 2 0.025 8 &gt;=256 0.002 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 64 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [19] 1 0.5 0.25 2 &lt;=0.001 1 2 </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-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> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 44 7 42 29 31 9 22 11 14 45 33 7 45 44 6 46 6 14 48 7 41 34 44 6 43</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 7 18 38 42 43 47 45 10 45 24 17 15 24 45 26 23 44 50 45 50 19 28 25 47 11</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-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> Class 'rsi'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S S S R I S R S I R R I I R R S I R S R R I I S I</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] R S R I I R I R R R I R I I S I I S I R I R R I S</span>
<span class="r-in"><span></span></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"># \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="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-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> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 0.25 2 0.5 256 2 1 16 0.0625 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.025 0.001 2 0.5 8 0.01 0.005 32 256 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.005 &lt;=0.001 32 16 256 4 0.005 0.0625 2 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.025 0.025 0.025 0.002 0.25 4 1 0.0625 0.025 0.0625</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 4 128 1 8 0.0625 0.125 0.0625 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [21] 2 8 0.002 0.5 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">"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-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> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5 4 16 0.5 0.5 1 16 16 2 32 16 4 0.5 1 1 1 4 16 1 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] &gt;=64 32 1 &lt;=0.5 16 1 16 2 1 1 32 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] 16 8 8 0.5 16 8 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [13] &lt;=0.5 2 32 2 8 4 16 32 2 1 4 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 8 </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-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> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &gt;=16 &gt;=16 2 &lt;=0.125 &gt;=16 2 1 &lt;=0.125 1 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.125 &gt;=4 0.5 1 1 0.5 1 0.125 0.125 0.25 0.125 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 8 4 4 0.25 0.5 2 2 4 8 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [13] 0.25 0.125 0.5 0.5 0.125 &gt;=4 &gt;=4 2 &gt;=4 0.5 2 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.25 8 1 8 2 0.25 0.25 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> [25] 2 </span>
<span class="r-in"><span></span></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-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> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 45 43 20 45 28 12 21 15 46 35 46 45 25 18 16 47 40 35 36 14 21 24 25 8</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 42 28 19 47 45 39 48 47 43 30 43 37 43 34 16 45 36 22 26 25 11 28 17 11 41</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-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> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 15 13 16 17 17 13 15 17 11 17 16 15 11 13 15 11 11 13 13 11 13 11 15 16 17</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 13 16 12 16 14 12 15 14 12 11 13 16 12 14 16 12 13 12 17 16 11 14 12 13 15</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-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> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 24 24 17 16 26 16 22 20 26 19 24 15 22 21 23 15 17 21 22 16 21 24 20 17 18</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 25 18 19 19 27 25 18 24 27 23 18 17 16 27 26 15 25 26 24 26 15 17 26 20 16</span>
<span class="r-in"><span><span class="co"># }</span></span></span> <span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div> </code></pre></div>
</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"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <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.0163956</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.01305892</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2> </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