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

Built site for AMR: 1.8.2.9121@45a9697

This commit is contained in:
github-actions 2023-02-12 16:20:08 +00:00
parent 7c0ad08c8a
commit a15da467b3
102 changed files with 574 additions and 559 deletions

View File

@ -36,7 +36,7 @@
<a class="navbar-brand me-2" href="https://msberends.github.io/AMR/index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -391,12 +391,12 @@ data set:</p>
<col width="13%">
<col width="13%">
<col width="13%">
<col width="28%">
<col width="26%">
<col width="5%">
<col width="5%">
<col width="5%">
<col width="5%">
<col width="8%">
<col width="9%">
</colgroup>
<thead><tr class="header">
<th align="center">date</th>
@ -411,68 +411,68 @@ data set:</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2015-12-16</td>
<td align="center">B5</td>
<td align="center">2016-05-20</td>
<td align="center">F10</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-01-08</td>
<td align="center">J1</td>
<td align="center">Hospital D</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2013-11-05</td>
<td align="center">N5</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2010-12-18</td>
<td align="center">E4</td>
<td align="center">2014-08-21</td>
<td align="center">H5</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">I</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>
</tr>
<tr class="odd">
<td align="center">2012-09-14</td>
<td align="center">G1</td>
<td align="center">2010-04-25</td>
<td align="center">G5</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2012-08-19</td>
<td align="center">V5</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">I</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2012-08-20</td>
<td align="center">V8</td>
<td align="center">Hospital D</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">I</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2011-09-02</td>
<td align="center">M4</td>
<td align="center">2011-10-28</td>
<td align="center">C6</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
@ -510,16 +510,16 @@ Longest: 1</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">M</td>
<td align="right">10,451</td>
<td align="right">52.26%</td>
<td align="right">10,451</td>
<td align="right">52.26%</td>
<td align="right">10,292</td>
<td align="right">51.46%</td>
<td align="right">10,292</td>
<td align="right">51.46%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">F</td>
<td align="right">9,549</td>
<td align="right">47.75%</td>
<td align="right">9,708</td>
<td align="right">48.54%</td>
<td align="right">20,000</td>
<td align="right">100.00%</td>
</tr>
@ -632,7 +632,7 @@ 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"># 2</span></span>
<span><span class="co"># Including isolates from ICU.</span></span>
<span><span class="co"># =&gt; Found 12,299 'phenotype-based' first isolates (61.5% of total where a</span></span>
<span><span class="co"># =&gt; Found 12,297 'phenotype-based' first isolates (61.5% of total where a</span></span>
<span><span class="co"># microbial ID was available)</span></span></code></pre></div>
<p>So only 61.5% is suitable for resistance analysis! We can now filter
on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter()</a></code> function, also from the
@ -644,7 +644,7 @@ on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html"
<div class="sourceCode" id="cb16"><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>
<span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p>So we end up with 12 299 isolates for analysis. Now our data looks
<p>So we end up with 12 297 isolates for analysis. Now our data looks
like:</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">data_1st</span><span class="op">)</span></span></code></pre></div>
@ -683,63 +683,31 @@ like:</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="center">2015-12-16</td>
<td align="center">B5</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">I</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="center">2017-01-08</td>
<td align="center">J1</td>
<td align="center">2014-08-21</td>
<td align="center">H5</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">B_ESCHR_COLI</td>
<td align="center">I</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="left">3</td>
<td align="center">2013-11-05</td>
<td align="center">N5</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">I</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">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">5</td>
<td align="center">2012-09-14</td>
<td align="center">G1</td>
<td align="center">Hospital A</td>
<td align="left">3</td>
<td align="center">2010-04-25</td>
<td align="center">G5</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
@ -747,37 +715,69 @@ like:</p>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">7</td>
<td align="center">2016-07-29</td>
<td align="center">A6</td>
<td align="center">Hospital B</td>
<td align="left">5</td>
<td align="center">2012-08-20</td>
<td align="center">V8</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">I</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">8</td>
<td align="center">2010-08-11</td>
<td align="center">J10</td>
<td align="center">Hospital C</td>
<td align="left">7</td>
<td align="center">2015-05-23</td>
<td align="center">I3</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">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="left">13</td>
<td align="center">2015-12-07</td>
<td align="center">V6</td>
<td align="center">Hospital B</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">R</td>
<td align="center">M</td>
<td align="center">I</td>
<td align="center">I</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">15</td>
<td align="center">2017-06-15</td>
<td align="center">L5</td>
<td align="center">Hospital A</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>
</tbody>
</table>
<p>Time for the analysis!</p>
@ -811,8 +811,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>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 12,299<br>
Available: 12,299 (100%, NA: 0 = 0%)<br>
Length: 12,297<br>
Available: 12,297 (100%, NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -837,33 +837,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">5,862</td>
<td align="right">47.66%</td>
<td align="right">5,862</td>
<td align="right">47.66%</td>
<td align="right">5,911</td>
<td align="right">48.07%</td>
<td align="right">5,911</td>
<td align="right">48.07%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,231</td>
<td align="right">26.27%</td>
<td align="right">9,093</td>
<td align="right">73.93%</td>
<td align="right">3,287</td>
<td align="right">26.73%</td>
<td align="right">9,198</td>
<td align="right">74.80%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">1,864</td>
<td align="right">15.16%</td>
<td align="right">10,957</td>
<td align="right">89.09%</td>
<td align="right">1,780</td>
<td align="right">14.48%</td>
<td align="right">10,978</td>
<td align="right">89.27%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,342</td>
<td align="right">10.91%</td>
<td align="right">12,299</td>
<td align="right">1,319</td>
<td align="right">10.73%</td>
<td align="right">12,297</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -884,14 +884,14 @@ antibiotic class they are in:</p>
<col width="9%">
<col width="9%">
<col width="9%">
<col width="10%">
<col width="11%">
<col width="3%">
<col width="3%">
<col width="3%">
<col width="3%">
<col width="6%">
<col width="11%">
<col width="12%">
<col width="11%">
<col width="9%">
<col width="5%">
</colgroup>
@ -912,8 +912,53 @@ antibiotic class they are in:</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2015-12-16</td>
<td align="center">B5</td>
<td align="center">2015-05-23</td>
<td align="center">I3</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">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">2011-10-04</td>
<td align="center">T8</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">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">2011-12-01</td>
<td align="center">U8</td>
<td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">I</td>
<td align="center">I</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">2015-07-22</td>
<td align="center">G8</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
@ -926,79 +971,34 @@ antibiotic class they are in:</p>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2017-01-08</td>
<td align="center">J1</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">I</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">2013-11-05</td>
<td align="center">N5</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">I</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="even">
<td align="center">2012-09-14</td>
<td align="center">G1</td>
<td align="center">Hospital A</td>
<td align="center">2010-06-18</td>
<td align="center">Z9</td>
<td align="center">Hospital C</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">R</td>
<td align="center">M</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2010-08-11</td>
<td align="center">J10</td>
<td align="center">Hospital C</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">R</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="even">
<td align="center">2013-06-29</td>
<td align="center">S10</td>
<td align="center">2014-10-01</td>
<td align="center">Q6</td>
<td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">I</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">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -1025,46 +1025,46 @@ different bug/drug combinations, you can use the
<td align="left">2</td>
<td align="center">E. coli</td>
<td align="center">AMC</td>
<td align="center">2700</td>
<td align="center">1233</td>
<td align="center">1929</td>
<td align="center">5862</td>
<td align="center">2771</td>
<td align="center">1193</td>
<td align="center">1947</td>
<td align="center">5911</td>
</tr>
<tr class="even">
<td align="left">1</td>
<td align="center">E. coli</td>
<td align="center">AMX</td>
<td align="center">1457</td>
<td align="center">1262</td>
<td align="center">3143</td>
<td align="center">5862</td>
<td align="center">1522</td>
<td align="center">1245</td>
<td align="center">3144</td>
<td align="center">5911</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">1973</td>
<td align="center">1841</td>
<td align="center">2048</td>
<td align="center">5862</td>
<td align="center">2061</td>
<td align="center">1814</td>
<td align="center">2036</td>
<td align="center">5911</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">2004</td>
<td align="center">1842</td>
<td align="center">2016</td>
<td align="center">5862</td>
<td align="center">2057</td>
<td align="center">1807</td>
<td align="center">2047</td>
<td align="center">5911</td>
</tr>
<tr class="odd">
<td align="left">6</td>
<td align="center">K. pneumoniae</td>
<td align="center">AMC</td>
<td align="center">605</td>
<td align="center">264</td>
<td align="center">473</td>
<td align="center">1342</td>
<td align="center">564</td>
<td align="center">294</td>
<td align="center">461</td>
<td align="center">1319</td>
</tr>
<tr class="even">
<td align="left">5</td>
@ -1072,8 +1072,8 @@ different bug/drug combinations, you can use the
<td align="center">AMX</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">1342</td>
<td align="center">1342</td>
<td align="center">1319</td>
<td align="center">1319</td>
</tr>
</tbody>
</table>
@ -1095,34 +1095,34 @@ different bug/drug combinations, you can use the
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">2004</td>
<td align="center">1842</td>
<td align="center">2016</td>
<td align="center">5862</td>
<td align="center">2057</td>
<td align="center">1807</td>
<td align="center">2047</td>
<td align="center">5911</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">GEN</td>
<td align="center">449</td>
<td align="center">429</td>
<td align="center">464</td>
<td align="center">1342</td>
<td align="center">454</td>
<td align="center">417</td>
<td align="center">448</td>
<td align="center">1319</td>
</tr>
<tr class="odd">
<td align="center">S. aureus</td>
<td align="center">GEN</td>
<td align="center">1116</td>
<td align="center">1009</td>
<td align="center">1106</td>
<td align="center">3231</td>
<td align="center">1142</td>
<td align="center">1041</td>
<td align="center">1104</td>
<td align="center">3287</td>
</tr>
<tr class="even">
<td align="center">S. pneumoniae</td>
<td align="center">GEN</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">1864</td>
<td align="center">1864</td>
<td align="center">1780</td>
<td align="center">1780</td>
</tr>
</tbody>
</table>
@ -1154,7 +1154,7 @@ I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equa
own:</p>
<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span><span class="op">(</span><span class="va">AMX</span><span class="op">)</span></span>
<span><span class="co"># [1] 0.5870396</span></span></code></pre></div>
<span><span class="co"># [1] 0.58128</span></span></code></pre></div>
<p>Or can be used in conjunction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by()</a></code> and
<code><a href="https://dplyr.tidyverse.org/reference/summarise.html" class="external-link">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r">
@ -1169,19 +1169,19 @@ own:</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5791485</td>
<td align="center">0.5788164</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5819352</td>
<td align="center">0.5898375</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.6098081</td>
<td align="center">0.5721206</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5905316</td>
<td align="center">0.5766096</td>
</tr>
</tbody>
</table>
@ -1206,23 +1206,23 @@ all isolates available for every group (i.e. values S, I or R):</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5791485</td>
<td align="center">3664</td>
<td align="center">0.5788164</td>
<td align="center">3616</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5819352</td>
<td align="center">4351</td>
<td align="center">0.5898375</td>
<td align="center">4369</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.6098081</td>
<td align="center">1876</td>
<td align="center">0.5721206</td>
<td align="center">1858</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5905316</td>
<td align="center">2408</td>
<td align="center">0.5766096</td>
<td align="center">2454</td>
</tr>
</tbody>
</table>
@ -1247,27 +1247,27 @@ therapies very easily:</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.6709314</td>
<td align="center">0.6560901</td>
<td align="center">0.8901399</td>
<td align="center">0.6706141</td>
<td align="center">0.6536965</td>
<td align="center">0.8820842</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.6475410</td>
<td align="center">0.6542474</td>
<td align="center">0.8792846</td>
<td align="center">0.6504928</td>
<td align="center">0.6603487</td>
<td align="center">0.8885519</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.6601671</td>
<td align="center">0.6576911</td>
<td align="center">0.8895079</td>
<td align="center">0.6671737</td>
<td align="center">0.6641314</td>
<td align="center">0.8910861</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.4812232</td>
<td align="center">0.4747191</td>
<td align="center">0.0000000</td>
<td align="center">0.4812232</td>
<td align="center">0.4747191</td>
</tr>
</tbody>
</table>
@ -1296,22 +1296,22 @@ classes, use a antibiotic class selector such as
<tr class="odd">
<td align="left">Hospital A</td>
<td align="right">57.9%</td>
<td align="right">35.8%</td>
<td align="right">36.2%</td>
</tr>
<tr class="even">
<td align="left">Hospital B</td>
<td align="right">58.2%</td>
<td align="right">36.2%</td>
<td align="right">59.0%</td>
<td align="right">36.5%</td>
</tr>
<tr class="odd">
<td align="left">Hospital C</td>
<td align="right">61.0%</td>
<td align="right">36.7%</td>
<td align="right">57.2%</td>
<td align="right">35.1%</td>
</tr>
<tr class="even">
<td align="left">Hospital D</td>
<td align="right">59.1%</td>
<td align="right">36.9%</td>
<td align="right">57.7%</td>
<td align="right">35.9%</td>
</tr>
</tbody>
</table>
@ -1427,18 +1427,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>
<span><span class="va">mic_values</span></span>
<span><span class="co"># Class 'mic'</span></span>
<span><span class="co"># [1] 2 0.005 1 8 8 16 &gt;=256 0.025 8 </span></span>
<span><span class="co"># [10] 8 &lt;=0.001 0.01 0.25 0.025 0.125 0.125 2 2 </span></span>
<span><span class="co"># [19] 32 1 0.25 16 64 0.01 4 0.002 8 </span></span>
<span><span class="co"># [28] 16 0.0625 1 &lt;=0.001 0.0625 0.01 2 1 0.5 </span></span>
<span><span class="co"># [37] 2 1 0.5 0.5 0.01 128 1 &lt;=0.001 1 </span></span>
<span><span class="co"># [46] 4 &lt;=0.001 0.002 0.125 128 0.01 16 64 32 </span></span>
<span><span class="co"># [55] &gt;=256 0.0625 0.25 0.125 128 0.01 &lt;=0.001 0.002 0.0625 </span></span>
<span><span class="co"># [64] 64 0.25 1 0.025 4 0.5 0.01 0.002 8 </span></span>
<span><span class="co"># [73] 16 0.5 &lt;=0.001 128 2 0.002 0.025 8 0.01 </span></span>
<span><span class="co"># [82] 64 32 0.002 &lt;=0.001 0.5 0.5 0.005 &gt;=256 0.025 </span></span>
<span><span class="co"># [91] 0.0625 128 32 0.01 16 64 0.125 0.5 64 </span></span>
<span><span class="co"># [100] 0.25</span></span></code></pre></div>
<span><span class="co"># [1] 4 0.5 0.5 32 0.005 0.025 2 128 0.025 </span></span>
<span><span class="co"># [10] 2 16 0.002 0.5 &gt;=256 &lt;=0.001 &gt;=256 0.002 0.0625 </span></span>
<span><span class="co"># [19] 0.025 0.005 16 128 0.005 8 0.25 128 0.25 </span></span>
<span><span class="co"># [28] 2 0.002 128 64 8 &gt;=256 8 0.025 &gt;=256 </span></span>
<span><span class="co"># [37] 0.5 0.01 0.25 8 0.0625 0.025 &gt;=256 0.005 2 </span></span>
<span><span class="co"># [46] 128 &gt;=256 0.005 0.5 &gt;=256 &lt;=0.001 0.005 0.0625 1 </span></span>
<span><span class="co"># [55] 0.5 0.125 16 0.002 0.005 16 4 0.01 0.25 </span></span>
<span><span class="co"># [64] 64 0.0625 0.002 32 0.5 4 8 128 32 </span></span>
<span><span class="co"># [73] 1 1 0.002 2 0.0625 &lt;=0.001 0.0625 &gt;=256 2 </span></span>
<span><span class="co"># [82] 8 0.125 0.0625 2 0.125 128 1 &gt;=256 4 </span></span>
<span><span class="co"># [91] 16 0.25 0.125 1 0.0625 0.125 &gt;=256 0.005 &lt;=0.001</span></span>
<span><span class="co"># [100] &gt;=256</span></span></code></pre></div>
<div class="sourceCode" id="cb36"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span>
<span><span class="fu"><a href="../reference/plot.html">plot</a></span><span class="op">(</span><span class="va">mic_values</span><span class="op">)</span></span></code></pre></div>
@ -1472,10 +1472,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>
<span><span class="va">disk_values</span></span>
<span><span class="co"># Class 'disk'</span></span>
<span><span class="co"># [1] 22 30 24 28 31 26 27 25 31 17 20 23 22 30 28 24 20 20 18 31 21 24 19 25 21</span></span>
<span><span class="co"># [26] 19 22 26 22 20 31 26 31 20 17 23 25 31 23 26 24 17 24 21 25 18 26 27 17 17</span></span>
<span><span class="co"># [51] 26 20 20 18 26 24 29 22 28 29 30 21 28 31 30 17 28 17 19 27 24 21 18 21 18</span></span>
<span><span class="co"># [76] 24 30 18 18 24 28 27 17 31 28 29 31 18 20 30 29 31 28 31 19 22 28 28 26 30</span></span></code></pre></div>
<span><span class="co"># [1] 21 26 26 27 23 17 20 22 22 20 21 22 31 21 21 23 17 23 17 31 23 19 31 20 29</span></span>
<span><span class="co"># [26] 22 27 18 20 24 25 29 23 23 30 28 28 29 30 21 24 19 17 30 17 17 21 17 28 20</span></span>
<span><span class="co"># [51] 24 19 18 17 27 19 29 21 17 27 20 18 30 21 17 30 29 24 21 18 28 18 24 25 31</span></span>
<span><span class="co"># [76] 27 24 29 22 19 17 25 26 27 29 24 28 22 19 30 31 18 19 24 22 27 20 22 26 18</span></span></code></pre></div>
<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># base R:</span></span>
<span><span class="fu"><a href="../reference/plot.html">plot</a></span><span class="op">(</span><span class="va">disk_values</span>, mo <span class="op">=</span> <span class="st">"E. coli"</span>, ab <span class="op">=</span> <span class="st">"cipro"</span><span class="op">)</span></span></code></pre></div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

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

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -385,19 +385,19 @@ names or codes, this would have worked exactly the same way:</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span></span>
<span><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
<span><span class="co"># 1 I R S S R I</span></span>
<span><span class="co"># 2 S S I S S I</span></span>
<span><span class="co"># 3 R S S S I R</span></span>
<span><span class="co"># 4 S I R I S R</span></span>
<span><span class="co"># 5 R I S S S S</span></span>
<span><span class="co"># 6 R R R S R I</span></span>
<span><span class="co"># 1 R S S I I S</span></span>
<span><span class="co"># 2 R S I R S R</span></span>
<span><span class="co"># 3 I S S S S I</span></span>
<span><span class="co"># 4 I I R I I S</span></span>
<span><span class="co"># 5 I S R I S R</span></span>
<span><span class="co"># 6 S S S I I S</span></span>
<span><span class="co"># kanamycin</span></span>
<span><span class="co"># 1 R</span></span>
<span><span class="co"># 1 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 I</span></span>
<span><span class="co"># 5 S</span></span>
<span><span class="co"># 6 I</span></span></code></pre></div>
<span><span class="co"># 5 I</span></span>
<span><span class="co"># 6 R</span></span></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can
use:</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
@ -438,40 +438,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3179</td>
<td align="right">63.58%</td>
<td align="right">3179</td>
<td align="right">63.58%</td>
<td align="right">3220</td>
<td align="right">64.40%</td>
<td align="right">3220</td>
<td align="right">64.40%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">1012</td>
<td align="right">20.24%</td>
<td align="right">4191</td>
<td align="right">83.82%</td>
<td align="right">941</td>
<td align="right">18.82%</td>
<td align="right">4161</td>
<td align="right">83.22%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">455</td>
<td align="right">9.10%</td>
<td align="right">4646</td>
<td align="right">92.92%</td>
<td align="right">474</td>
<td align="right">9.48%</td>
<td align="right">4635</td>
<td align="right">92.70%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">247</td>
<td align="right">4.94%</td>
<td align="right">4893</td>
<td align="right">97.86%</td>
<td align="right">238</td>
<td align="right">4.76%</td>
<td align="right">4873</td>
<td align="right">97.46%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">107</td>
<td align="right">2.14%</td>
<td align="right">127</td>
<td align="right">2.54%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -38,7 +38,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -42,7 +42,7 @@
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -142,7 +142,7 @@
</div>
<div class="section level2">
<h2 class="pkg-version" data-toc-text="1.8.2.9120" id="amr-1829120">AMR 1.8.2.9120<a class="anchor" aria-label="anchor" href="#amr-1829120"></a></h2>
<h2 class="pkg-version" data-toc-text="1.8.2.9121" id="amr-1829121">AMR 1.8.2.9121<a class="anchor" aria-label="anchor" href="#amr-1829121"></a></h2>
<p><em>(this beta version will eventually become v2.0! Were happy to reach a new major milestone soon!)</em></p>
<p>This is a new major release of the AMR package, with great new additions but also some breaking changes for current users. These are all listed below.</p>
<p><strong><a href="https://en.wikipedia.org/wiki/TL;DR" class="external-link">TL;DR</a></strong></p>
@ -156,32 +156,32 @@
<li>Now available in 20 languages</li>
<li>Many small bug fixes</li>
</ul><div class="section level3">
<h3 id="new-1-8-2-9120">New<a class="anchor" aria-label="anchor" href="#new-1-8-2-9120"></a></h3>
<h3 id="new-1-8-2-9121">New<a class="anchor" aria-label="anchor" href="#new-1-8-2-9121"></a></h3>
<div class="section level4">
<h4 id="sir-vs-rsi-1-8-2-9120">SIR vs. RSI<a class="anchor" aria-label="anchor" href="#sir-vs-rsi-1-8-2-9120"></a></h4>
<h4 id="sir-vs-rsi-1-8-2-9121">SIR vs. RSI<a class="anchor" aria-label="anchor" href="#sir-vs-rsi-1-8-2-9121"></a></h4>
<p>For this milestone version, we replaced all mentions of RSI with SIR, to comply with what is actually being commonly used in the field of clinical microbiology when it comes to this tri-form regarding AMR.</p>
<p>While existing functions such as <code><a href="../reference/AMR-deprecated.html">as.rsi()</a></code>, <code><a href="../reference/AMR-deprecated.html">rsi_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">ggplot_rsi()</a></code> still work, their replacements <code><a href="../reference/as.sir.html">as.sir()</a></code>, <code><a href="../reference/proportion.html">sir_df()</a></code>, <code><a href="../reference/ggplot_sir.html">ggplot_sir()</a></code> are now the current functions for AMR data analysis. A warning will be thrown once a session to remind users about this. The data set <code>rsi_translation</code> is now called <code>clinical_breakpoints</code> to better reflect its content.</p>
<p>The RSI functions will be removed in a future version, but not before late 2023 / early 2024.</p>
</div>
<div class="section level4">
<h4 id="new-antibiogram-function-1-8-2-9120">New antibiogram function<a class="anchor" aria-label="anchor" href="#new-antibiogram-function-1-8-2-9120"></a></h4>
<h4 id="new-antibiogram-function-1-8-2-9121">New antibiogram function<a class="anchor" aria-label="anchor" href="#new-antibiogram-function-1-8-2-9121"></a></h4>
<p>With the new <code><a href="../reference/antibiogram.html">antibiogram()</a></code> function, users can now generate traditional, combined, syndromic, and even weighted-incidence syndromic combination antibiograms (WISCA). With this, we follow the logic in the previously described work of Klinker <em>et al.</em> (2021, DOI <a href="https://doi.org/10.1177/20499361211011373" class="external-link">10.1177/20499361211011373</a>) and Barbieri <em>et al.</em> (2021, DOI <a href="https://doi.org/10.1186/s13756-021-00939-2" class="external-link">10.1186/s13756-021-00939-2</a>).</p>
<p>The help page for <code><a href="../reference/antibiogram.html">antibiogram()</a></code> extensively elaborates on use cases, and <code><a href="../reference/antibiogram.html">antibiogram()</a></code> also supports printing in R Markdown and Quarto, with support for 20 languages.</p>
<p>Furthermore, different plotting methods were implemented to allow for graphical visualisations as well.</p>
</div>
<div class="section level4">
<h4 id="interpretation-of-mic-and-disk-diffusion-values-1-8-2-9120">Interpretation of MIC and disk diffusion values<a class="anchor" aria-label="anchor" href="#interpretation-of-mic-and-disk-diffusion-values-1-8-2-9120"></a></h4>
<h4 id="interpretation-of-mic-and-disk-diffusion-values-1-8-2-9121">Interpretation of MIC and disk diffusion values<a class="anchor" aria-label="anchor" href="#interpretation-of-mic-and-disk-diffusion-values-1-8-2-9121"></a></h4>
<p>The clinical breakpoints and intrinsic resistance of EUCAST 2022 and CLSI 2022 have been added for <code><a href="../reference/as.sir.html">as.sir()</a></code>. EUCAST 2022 (v12.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> to apply EUCAST Expert Rules. The default guideline (EUCAST) can now be changed with the new <code>AMR_guideline</code> option, such as: <code>options(AMR_guideline = "CLSI 2020")</code>.</p>
<p>With the new arguments <code>include_PKPD</code> (default: <code>TRUE</code>) and <code>include_screening</code> (default: <code>FALSE</code>), users can now specify whether breakpoints for screening and from the PK/PD table should be included when interpreting MICs and disks diffusion values. These options can be set globally, which can be read in <a href="https://msberends.github.io/AMR/reference/AMR-options.html">our new manual</a>.</p>
<p>Interpretation guidelines older than 10 years were removed, the oldest now included guidelines of EUCAST and CLSI are from 2013.</p>
</div>
<div class="section level4">
<h4 id="supported-languages-1-8-2-9120">Supported languages<a class="anchor" aria-label="anchor" href="#supported-languages-1-8-2-9120"></a></h4>
<h4 id="supported-languages-1-8-2-9121">Supported languages<a class="anchor" aria-label="anchor" href="#supported-languages-1-8-2-9121"></a></h4>
<p>We added support for the following ten languages: Chinese (simplified), Czech, Finnish, Greek, Japanese, Norwegian (bokmål), Polish, Romanian, Turkish and Ukrainian. All antibiotic names are now available in these languages, and the AMR package will automatically determine a supported language based on the users system language.</p>
<p>We are very grateful for the valuable input by our colleagues from other countries. The <code>AMR</code> package is now available in 20 languages in total, and according to download stats used in almost all countries in the world!</p>
</div>
<div class="section level4">
<h4 id="microbiological-taxonomy-1-8-2-9120">Microbiological taxonomy<a class="anchor" aria-label="anchor" href="#microbiological-taxonomy-1-8-2-9120"></a></h4>
<h4 id="microbiological-taxonomy-1-8-2-9121">Microbiological taxonomy<a class="anchor" aria-label="anchor" href="#microbiological-taxonomy-1-8-2-9121"></a></h4>
<p>The <code>microorganisms</code> data set no longer relies on the Catalogue of Life, but on the List of Prokaryotic names with Standing in Nomenclature (LPSN) and is supplemented with the backbone taxonomy from the Global Biodiversity Information Facility (GBIF). The structure of this data set has changed to include separate LPSN and GBIF identifiers. Almost all previous MO codes were retained. It contains over 1,400 taxonomic names from 2022.</p>
<p>We previously relied on our own experience to categorise species into pathogenic groups, but we were very happy to encounter the very recent work of Bartlett <em>et al.</em> (2022, DOI <a href="https://doi.org/10.1099/mic.0.001269" class="external-link">10.1099/mic.0.001269</a>) who extensively studied medical-scientific literature to categorise all bacterial species into groups. See <code><a href="../reference/mo_matching_score.html">mo_matching_score()</a></code> on how their work was incorporated into the <code>prevalence</code> column of the <code>microorganisms</code> data set. Using their results, the <code><a href="../reference/as.mo.html">as.mo()</a></code> and all <code>mo_*()</code> functions are now much better capable of converting user input to valid taxonomic records.</p>
<p>The new function <code><a href="../reference/add_custom_microorganisms.html">add_custom_microorganisms()</a></code> allows users to add custom microorganisms to the <code>AMR</code> package.</p>
@ -205,7 +205,7 @@
<li>The <code>microorganisms.old</code> data set was removed, and all previously accepted names are now included in the <code>microorganisms</code> data set. A new column <code>status</code> contains <code>"accepted"</code> for currently accepted names and <code>"synonym"</code> for taxonomic synonyms; currently invalid names. All previously accepted names now have a microorganisms ID and - if available - an LPSN, GBIF and SNOMED CT identifier.</li>
</ul></div>
<div class="section level4">
<h4 id="antibiotic-agents-and-selectors-1-8-2-9120">Antibiotic agents and selectors<a class="anchor" aria-label="anchor" href="#antibiotic-agents-and-selectors-1-8-2-9120"></a></h4>
<h4 id="antibiotic-agents-and-selectors-1-8-2-9121">Antibiotic agents and selectors<a class="anchor" aria-label="anchor" href="#antibiotic-agents-and-selectors-1-8-2-9121"></a></h4>
<p>The new function <code><a href="../reference/add_custom_antimicrobials.html">add_custom_antimicrobials()</a></code> allows users to add custom antimicrobial codes and names to the <code>AMR</code> package.</p>
<p>The <code>antibiotics</code> data set was greatly updated:</p>
<ul><li>The following 20 antibiotics have been added (also includes the <a href="https://www.whocc.no/atc_ddd_index/?code=J01RA&amp;showdescription=no" class="external-link">new J01RA ATC group</a>): azithromycin/fluconazole/secnidazole (AFC), cefepime/amikacin (CFA), cefixime/ornidazole (CEO), ceftriaxone/beta-lactamase inhibitor (CEB), ciprofloxacin/metronidazole (CIM), ciprofloxacin/ornidazole (CIO), ciprofloxacin/tinidazole (CIT), furazidin (FUR), isoniazid/sulfamethoxazole/trimethoprim/pyridoxine (IST), lascufloxacin (LSC), levofloxacin/ornidazole (LEO), nemonoxacin (NEM), norfloxacin/metronidazole (NME), norfloxacin/tinidazole (NTI), ofloxacin/ornidazole (OOR), oteseconazole (OTE), rifampicin/ethambutol/isoniazid (REI), sarecycline (SRC), tetracycline/oleandomycin (TOL), and thioacetazone (TAT)</li>
@ -217,14 +217,14 @@
</ul><p>Also, we added support for using antibiotic selectors in scoped <code>dplyr</code> verbs (with or without using <code><a href="https://dplyr.tidyverse.org/reference/vars.html" class="external-link">vars()</a></code>), such as in: <code>... %&gt;% summarise_at(aminoglycosides(), resistance)</code>, please see <code><a href="../reference/proportion.html">resistance()</a></code> for examples.</p>
</div>
<div class="section level4">
<h4 id="antiviral-agents-1-8-2-9120">Antiviral agents<a class="anchor" aria-label="anchor" href="#antiviral-agents-1-8-2-9120"></a></h4>
<h4 id="antiviral-agents-1-8-2-9121">Antiviral agents<a class="anchor" aria-label="anchor" href="#antiviral-agents-1-8-2-9121"></a></h4>
<p>We now added extensive support for antiviral agents! For the first time, the <code>AMR</code> package has extensive support for antiviral drugs and to work with their names, codes and other data in any way.</p>
<ul><li>The <code>antivirals</code> data set has been extended with 18 new drugs (also from the <a href="https://www.whocc.no/atc_ddd_index/?code=J05AJ&amp;showdescription=no" class="external-link">new J05AJ ATC group</a>) and now also contains antiviral identifiers and LOINC codes</li>
<li>A new data type <code>av</code> (<em>antivirals</em>) has been added, which is functionally similar to <code>ab</code> for antibiotics</li>
<li>Functions <code><a href="../reference/as.av.html">as.av()</a></code>, <code><a href="../reference/av_property.html">av_name()</a></code>, <code><a href="../reference/av_property.html">av_atc()</a></code>, <code><a href="../reference/av_property.html">av_synonyms()</a></code>, <code><a href="../reference/av_from_text.html">av_from_text()</a></code> have all been added as siblings to their <code>ab_*()</code> equivalents</li>
</ul></div>
<div class="section level4">
<h4 id="other-new-functions-1-8-2-9120">Other new functions<a class="anchor" aria-label="anchor" href="#other-new-functions-1-8-2-9120"></a></h4>
<h4 id="other-new-functions-1-8-2-9121">Other new functions<a class="anchor" aria-label="anchor" href="#other-new-functions-1-8-2-9121"></a></h4>
<ul><li>Function <code><a href="../reference/proportion.html">sir_confidence_interval()</a></code> to add confidence intervals in AMR calculation. This is now also included in <code><a href="../reference/proportion.html">sir_df()</a></code> and <code><a href="../reference/proportion.html">proportion_df()</a></code>.</li>
<li>Function <code><a href="../reference/mean_amr_distance.html">mean_amr_distance()</a></code> to calculate the mean AMR distance. The mean AMR distance is a normalised numeric value to compare AMR test results and can help to identify similar isolates, without comparing antibiograms by hand.</li>
<li>Function <code><a href="../reference/as.sir.html">sir_interpretation_history()</a></code> to view the history of previous runs of <code><a href="../reference/as.sir.html">as.sir()</a></code> (previously <code><a href="../reference/AMR-deprecated.html">as.rsi()</a></code>). This returns a logbook with the selected guideline, reference table and specific interpretation of each row in a data set on which <code><a href="../reference/as.sir.html">as.sir()</a></code> was run.</li>
@ -233,7 +233,7 @@
</ul></div>
</div>
<div class="section level3">
<h3 id="changes-1-8-2-9120">Changes<a class="anchor" aria-label="anchor" href="#changes-1-8-2-9120"></a></h3>
<h3 id="changes-1-8-2-9121">Changes<a class="anchor" aria-label="anchor" href="#changes-1-8-2-9121"></a></h3>
<ul><li>Argument <code>combine_IR</code> has been removed from this package (affecting functions <code><a href="../reference/count.html">count_df()</a></code>, <code><a href="../reference/proportion.html">proportion_df()</a></code>, and <code><a href="../reference/proportion.html">sir_df()</a></code> and some plotting functions), since it was replaced with <code>combine_SI</code> three years ago</li>
<li>Using <code>units</code> in <code>ab_ddd(..., units = "...")</code> had been deprecated for some time and is now not supported anymore. Use <code><a href="../reference/ab_property.html">ab_ddd_units()</a></code> instead.</li>
<li>Support for <code>data.frame</code>-enhancing R packages, more specifically: <code><a href="https://Rdatatable.gitlab.io/data.table/reference/data.table.html" class="external-link">data.table::data.table</a></code>, <code><a href="https://sfirke.github.io/janitor/reference/tabyl.html" class="external-link">janitor::tabyl</a></code>, <code><a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibble::tibble</a></code>, and <code><a href="https://tsibble.tidyverts.org/reference/tsibble.html" class="external-link">tsibble::tsibble</a></code>. AMR package functions that have a data set as output (such as <code><a href="../reference/proportion.html">sir_df()</a></code> and <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code>), will now return the same data type as the input.</li>
@ -275,7 +275,7 @@
<code><a href="../reference/get_episode.html">get_episode()</a></code> now returns class <code>integer</code> instead of <code>numeric</code> since they are always whole numbers</li>
</ul></div>
<div class="section level3">
<h3 id="other-1-8-2-9120">Other<a class="anchor" aria-label="anchor" href="#other-1-8-2-9120"></a></h3>
<h3 id="other-1-8-2-9121">Other<a class="anchor" aria-label="anchor" href="#other-1-8-2-9121"></a></h3>
<ul><li>Added Peter Dutey-Magni, Dmytro Mykhailenko, Anton Mymrikov, Andrew Norgan, Jonas Salm, and Anita Williams as contributors, to thank them for their valuable input</li>
<li>New website to make use of the new Bootstrap 5 and pkgdown 2.0. The website now contains results for all examples and will be automatically regenerated with every change to our repository, using GitHub Actions</li>
<li>All R and Rmd files in this project are now styled using the <code>styler</code> package</li>

View File

@ -11,7 +11,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
last_built: 2023-02-12T14:14Z
last_built: 2023-02-12T16:15Z
urls:
reference: https://msberends.github.io/AMR/reference
article: https://msberends.github.io/AMR/articles

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -18,7 +18,7 @@ The AMR package is available in English, Chinese, Danish, Dutch, French, German,
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -205,16 +205,16 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">df</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> birth_date age age_exact age_at_y2k</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1992-02-02 31 31.02740 7</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1946-11-05 76 76.27123 53</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1941-11-26 81 81.21370 58</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1935-11-05 87 87.27123 64</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1976-09-09 46 46.42740 23</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1957-04-07 65 65.85205 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1981-12-01 41 41.20000 18</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1956-12-07 66 66.18356 43</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1932-02-10 91 91.00548 67</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1991-09-13 31 31.41644 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1984-09-01 38 38.44932 15</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1939-06-03 83 83.69589 60</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1997-05-06 25 25.77260 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1973-03-26 49 49.88493 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1952-08-31 70 70.45205 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1940-06-18 82 82.65479 59</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1993-04-22 29 29.81096 6</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1964-12-28 58 58.12603 35</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1988-11-02 34 34.27945 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1976-04-15 46 46.83014 23</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -14,7 +14,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -332,7 +332,8 @@
<span class="r-in"><span><span class="co"># Traditional antibiogram ----------------------------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (tobramycin), 'AMK' (amikacin) and 'KAN' (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)</span>
@ -350,11 +351,12 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> S. epidermidis (8-163) 0 79 <span style="color: #BB0000;">NA</span> 0 <span style="color: #BB0000;">NA</span> 51</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> S. hominis (3-80) <span style="color: #BB0000;">NA</span> 92 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> 85</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> S. pneumoniae (11-117) 0 0 <span style="color: #BB0000;">NA</span> 0 <span style="color: #BB0000;">NA</span> 0</span>
<span class="r-in"><span> </span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"atc"</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"atc"</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (tobramycin), 'AMK' (amikacin) and 'KAN' (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 4 combinations had less than minimum = 30 results and were ignored</span>
@ -363,11 +365,12 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">*</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;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-negative (35-686) 96 96 0 98</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-positive (436-1170) 34 63 0 0</span>
<span class="r-in"><span> </span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"name"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"name"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 172 combinations had less than minimum = 30 results and were ignored</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 5 × 3</span></span>
@ -384,20 +387,22 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># combined antibiotics yield higher empiric coverage</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 combinations had less than minimum = 30 results and were ignored</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Pathogen (N min-max)` TZP `TZP + GEN` `TZP + TOB`</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">*</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;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-negative (641-693) 88 99 98</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-positive (345-1044) 86 98 95</span>
<span class="r-in"><span> </span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> sep <span class="op">=</span> <span class="st">" &amp; "</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> sep <span class="op">=</span> <span class="st">" &amp; "</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 combinations had less than minimum = 30 results and were ignored</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 3</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Pathogen (N min-max)` `Piperacillin/tazobactam` Piperacillin/tazobactam &amp; …¹</span>
@ -411,8 +416,9 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># the data set could contain a filter for e.g. respiratory specimens</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (tobramycin), 'AMK' (amikacin) and 'KAN' (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)</span>
@ -442,11 +448,13 @@
<span class="r-in"><span><span class="co"># with a custom language, though this will be determined automatically</span></span></span>
<span class="r-in"><span><span class="co"># (i.e., this table will be in Spanish on Spanish systems)</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">ex1</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">ex1</span><span class="op">$</span><span class="va">ward</span> <span class="op">==</span> <span class="st">"ICU"</span>,</span></span>
<span class="r-in"><span> <span class="st">"UCI"</span>, <span class="st">"No UCI"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> language <span class="op">=</span> <span class="st">"es"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="antibiotic_class_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">ex1</span><span class="op">$</span><span class="va">ward</span> <span class="op">==</span> <span class="st">"ICU"</span>,</span></span>
<span class="r-in"><span> <span class="st">"UCI"</span>, <span class="st">"No UCI"</span></span></span>
<span class="r-in"><span> <span class="op">)</span>,</span></span>
<span class="r-in"><span> language <span class="op">=</span> <span class="st">"es"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (tobramycin), 'AMK' (amikacin) and 'KAN' (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 combinations had less than minimum = 30 results and were ignored</span>
@ -461,12 +469,14 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># the data set could contain a filter for e.g. respiratory specimens</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> minimum <span class="op">=</span> <span class="fl">10</span>, <span class="co"># this should be &gt;= 30, but now just as example</span></span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">age</span> <span class="op">&gt;=</span> <span class="fl">65</span> <span class="op">&amp;</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span><span class="op">$</span><span class="va">gender</span> <span class="op">==</span> <span class="st">"M"</span>,</span></span>
<span class="r-in"><span> <span class="st">"WISCA Group 1"</span>, <span class="st">"WISCA Group 2"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> minimum <span class="op">=</span> <span class="fl">10</span>, <span class="co"># this should be &gt;= 30, but now just as example</span></span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">age</span> <span class="op">&gt;=</span> <span class="fl">65</span> <span class="op">&amp;</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span><span class="op">$</span><span class="va">gender</span> <span class="op">==</span> <span class="st">"M"</span>,</span></span>
<span class="r-in"><span> <span class="st">"WISCA Group 1"</span>, <span class="st">"WISCA Group 2"</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-msg co"><span class="r-pr">#&gt;</span> 8 combinations had less than minimum = 10 results and were ignored</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 4 × 6</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Syndromic Group` `Pathogen (N min-max)` AMC `AMC + CIP` TZP `TZP + TOB`</span>
@ -480,15 +490,17 @@
<span class="r-in"><span><span class="co"># Generate plots with ggplot2 or base R --------------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">ab1</span> <span class="op">&lt;-</span> <span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 4 combinations had less than minimum = 30 results and were ignored</span>
<span class="r-in"><span><span class="va">ab2</span> <span class="op">&lt;-</span> <span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span><span class="op">)</span></span></span>
<span class="r-in"><span> antibiotics <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 16 combinations had less than minimum = 30 results and were ignored</span>
<span class="r-in"><span> </span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="plot.html">plot</a></span><span class="op">(</span><span class="va">ab1</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="antibiogram-1.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ All breakpoints used for interpretation are publicly available in the clinical_b
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -534,16 +534,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 50 × 17</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> datetime index ab_input ab_guid…¹ mo_in…² mo_guideline guide…³</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;ab&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 2023-02-12 <span style="color: #949494;">14:15:05</span> 1 TOB TOB Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2023-02-12 <span style="color: #949494;">14:15:05</span> 1 GEN GEN Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2023-02-12 <span style="color: #949494;">14:15:04</span> 1 CIP CIP Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2023-02-12 <span style="color: #949494;">14:15:04</span> 1 AMP AMP Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 1 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 2 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 3 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 4 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 5 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 2023-02-12 <span style="color: #949494;">14:14:59</span> 6 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 2023-02-12 <span style="color: #949494;">16:16:37</span> 1 TOB TOB Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2023-02-12 <span style="color: #949494;">16:16:36</span> 1 GEN GEN Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2023-02-12 <span style="color: #949494;">16:16:36</span> 1 CIP CIP Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2023-02-12 <span style="color: #949494;">16:16:36</span> 1 AMP AMP Escher… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 1 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 2 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 3 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 4 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 5 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 2023-02-12 <span style="color: #949494;">16:16:30</span> 6 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 40 more rows, 10 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;"># input &lt;dbl&gt;, outcome &lt;sir&gt;, breakpoint_S_R &lt;chr&gt;, ab_considered &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># mo_considered &lt;lgl&gt;, breakpoint_S &lt;lgl&gt;, breakpoint_R &lt;lgl&gt;,</span></span>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -192,38 +192,43 @@
<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">100</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 5 27 24 19 46 12 45 39 38 2 2 31 20 24 36 49 47 22 49 34 23 49 51 9 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 22 1 17 13 5 43 45 27 6 19 7 10 23 45 32 12 9 4 34 26 30 21 48 47 36</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 41 44 1 23 14 21 11 29 9 28 8 50 48 42 32 36 15 38 6 2 32 25 44 18 3</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 16 42 35 9 29 36 17 43 33 12 10 40 43 29 16 11 4 19 37 23 41 21 46 8 51</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 4 42 40 28 20 1 44 42 5 14 16 7 20 26 48 1 21 18 22 17 31 33 23 32 36</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 12 5 34 26 35 27 17 43 25 9 19 45 46 24 27 24 39 2 30 22 41 11 1 37 20</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 42 27 19 45 21 45 6 45 22 9 43 1 12 6 45 8 29 45 24 33 3 29 12 37 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 40 42 8 40 17 21 46 46 8 10 7 33 9 45 4 34 15 38 12 28 47 25 13 30 46</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] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE TRUE FALSE FALSE</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 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 AMC </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;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-06-18 012595 30 M ICU B_CRYNB I NA NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 35 more variables: AMP &lt;sir&gt;, TZP &lt;sir&gt;, CZO &lt;sir&gt;, FEP &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># CXM &lt;sir&gt;, FOX &lt;sir&gt;, CTX &lt;sir&gt;, CAZ &lt;sir&gt;, CRO &lt;sir&gt;, GEN &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TOB &lt;sir&gt;, AMK &lt;sir&gt;, KAN &lt;sir&gt;, TMP &lt;sir&gt;, SXT &lt;sir&gt;, NIT &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># FOS &lt;sir&gt;, LNZ &lt;sir&gt;, CIP &lt;sir&gt;, MFX &lt;sir&gt;, VAN &lt;sir&gt;, TEC &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TCY &lt;sir&gt;, TGC &lt;sir&gt;, DOX &lt;sir&gt;, ERY &lt;sir&gt;, CLI &lt;sir&gt;, AZM &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># IPM &lt;sir&gt;, MEM &lt;sir&gt;, MTR &lt;sir&gt;, CHL &lt;sir&gt;, COL &lt;sir&gt;, MUP &lt;sir&gt;, RIF &lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-06-19 402950 53 F Clinical B_STPHY_HMNS R NA S NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 36 more variables: AMC &lt;sir&gt;, AMP &lt;sir&gt;, TZP &lt;sir&gt;, CZO &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># FEP &lt;sir&gt;, CXM &lt;sir&gt;, FOX &lt;sir&gt;, CTX &lt;sir&gt;, CAZ &lt;sir&gt;, CRO &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># GEN &lt;sir&gt;, TOB &lt;sir&gt;, AMK &lt;sir&gt;, KAN &lt;sir&gt;, TMP &lt;sir&gt;, SXT &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># NIT &lt;sir&gt;, FOS &lt;sir&gt;, LNZ &lt;sir&gt;, CIP &lt;sir&gt;, MFX &lt;sir&gt;, VAN &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TEC &lt;sir&gt;, TCY &lt;sir&gt;, TGC &lt;sir&gt;, DOX &lt;sir&gt;, ERY &lt;sir&gt;, CLI &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># AZM &lt;sir&gt;, IPM &lt;sir&gt;, MEM &lt;sir&gt;, MTR &lt;sir&gt;, CHL &lt;sir&gt;, COL &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># MUP &lt;sir&gt;, RIF &lt;sir&gt;</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># the functions also work for less than a day, e.g. to include one per hour:</span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Sys.time.html" class="external-link">Sys.time</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/Sys.time.html" class="external-link">Sys.time</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fl">60</span> <span class="op">*</span> <span class="fl">60</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> episode_days <span class="op">=</span> <span class="fl">1</span> <span class="op">/</span> <span class="fl">24</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/Sys.time.html" class="external-link">Sys.time</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/Sys.time.html" class="external-link">Sys.time</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fl">60</span> <span class="op">*</span> <span class="fl">60</span></span></span>
<span class="r-in"><span> <span class="op">)</span>,</span></span>
<span class="r-in"><span> episode_days <span class="op">=</span> <span class="fl">1</span> <span class="op">/</span> <span class="fl">24</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> [1] 1 2</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
@ -238,23 +243,23 @@
<span class="r-in"><span> <span class="op">)</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">condition</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span>new_episode <span class="op">=</span> <span class="fu">is_new_episode</span><span class="op">(</span><span class="va">date</span>, <span class="fl">365</span><span class="op">)</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">date</span>, <span class="va">condition</span>, <span class="va">new_episode</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">date</span>, <span class="va">condition</span>, <span class="va">new_episode</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">condition</span>, <span class="va">date</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: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [97]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient date condition new_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 005088 2007-08-22 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 012595 2002-06-18 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 023456 2009-11-02 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 071099 2005-01-11 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 077552 2002-05-14 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 080086 2010-08-08 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 0E2483 2007-08-10 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 0E2483 2007-11-10 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 0E2483 2007-04-06 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 114570 2003-04-22 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 006827 2009-07-24 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 036063 2010-01-28 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 047634 2004-06-28 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 067927 2002-01-13 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 067927 2002-01-29 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 141061 2014-10-22 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 144549 2009-09-01 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 156730 2012-04-12 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 16F0F7 2010-01-17 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 1710B8 2008-01-22 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 90 more rows</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>
@ -264,23 +269,23 @@
<span class="r-in"><span> <span class="va">patient</span>,</span></span>
<span class="r-in"><span> new_index <span class="op">=</span> <span class="fu">get_episode</span><span class="op">(</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> new_logical <span class="op">=</span> <span class="fu">is_new_episode</span><span class="op">(</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="op">)</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="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">ward</span>, <span class="va">date</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: 100 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [95]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [97]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&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 2007-08-22 005088 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2002-06-18 012595 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2009-11-02 023456 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2005-01-11 071099 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2002-05-14 077552 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2010-08-08 080086 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2007-04-06 0E2483 2 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2007-11-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU 2007-08-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2003-04-22 114570 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2009-07-24 006827 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2010-01-28 036063 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2004-06-28 047634 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2002-01-13 067927 1 FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU 2002-01-29 067927 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2014-10-22 141061 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2009-09-01 144549 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2012-04-12 156730 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2010-01-17 16F0F7 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2008-01-22 1710B8 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 90 more rows</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>
@ -296,9 +301,9 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 58 14 41 49</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 31 11 25 27</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 6 5 6 6</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 62 13 36 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 32 12 24 28</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 3 2 3 3</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"># results as first_isolate() when using 'episode-based':</span></span></span>
@ -321,26 +326,25 @@
<span class="r-in"><span><span class="co"># but is_new_episode() has a lot more flexibility than first_isolate(),</span></span></span>
<span class="r-in"><span><span class="co"># since you can now group on anything that seems relevant:</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 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="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">mo</span>, <span class="va">ward</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span>flag_episode <span class="op">=</span> <span class="fu">is_new_episode</span><span class="op">(</span><span class="va">date</span>, <span class="fl">365</span><span class="op">)</span><span class="op">)</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="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [97]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [98]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 762305 B_BCTRD_FRGL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 889500 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 777449 B_STPHY_CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 59C7F2 B_STRPT_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 432724 B_STPHY_CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 690605 B_STRPT_DYSG ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> E04500 B_STPHY_HMNS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 255339 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 905108 B_STRPT_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 130252 B_ENTRC_FCLS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 374815 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> DB8625 B_STPHY_EPDR ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 759920 UNKNOWN ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 291882 B_STPHY_EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 403631 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 858515 B_STPHY_EPDR ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 219664 B_STPHY_HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 904640 B_PROTS_MRBL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> CBC201 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> D43733 B_ESCHR_COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># … with 90 more rows</span></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -182,9 +182,9 @@
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.984473</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.907871</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.0007148714</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.07034567</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -201,30 +201,30 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_sir</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">sir</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S R I S S I S R S I</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I R R R R R I I S S</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">sir</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.4743416 1.8973666 -0.4743416 -0.4743416 -0.4743416 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.4743416 1.8973666 -0.4743416 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.9486833 0.9486833 0.9486833 0.9486833 0.9486833 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.9486833 -0.9486833 -0.9486833 -0.9486833</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">mic</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">mic</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &gt;=256 32 8 0.005 0.002 16 16 4 0.125 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 16 1 256 0.125 128 0.01 0.002 4 0.5 64 </span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">mic</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.3250871 0.7850408 0.4250100 -1.4910484 -1.7290159 0.6050254</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.6050254 0.2449945 -0.6550826 -0.1150363</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5666465 -0.1284197 1.2617128 -0.6497194 1.0879462 -1.2828998</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -1.6863733 0.2191134 -0.3021863 0.9141797</span>
<span class="r-in"><span><span class="co"># equal to the Z-score of their log2:</span></span></span>
<span class="r-in"><span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span> <span class="op">-</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.3250871 0.7850408 0.4250100 -1.4910484 -1.7290159 0.6050254</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.6050254 0.2449945 -0.6550826 -0.1150363</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5666465 -0.1284197 1.2617128 -0.6497194 1.0879462 -1.2828998</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -1.6863733 0.2191134 -0.3021863 0.9141797</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">disk</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_disk</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">disk</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 50 49 21 41 42 7 13 6 10 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 15 35 11 14 42 16 45 41 41 47</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">disk</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.3154103 1.2587116 -0.3288526 0.8051218 0.8618206 -1.1226347</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.7824423 -1.1793334 -0.9525385 0.1247372</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -1.0643966 0.2915226 -1.3355804 -1.1321925 0.7660944 -0.9966006</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.9694822 0.6982984 0.6982984 1.1050742</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">y</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
<span class="r-in"><span> id <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>,</span></span>
@ -234,22 +234,22 @@
<span class="r-in"><span> tobr <span class="op">=</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span>, ab <span class="op">=</span> <span class="st">"tobr"</span>, mo <span class="op">=</span> <span class="st">"Escherichia coli"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">y</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A R 22 0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 26 2 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C I 27 4 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 30 0.25 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E S 17 2 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 30 2 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 19 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 23 0.25 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 27 1 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 31 4 2</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 S 19 2 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 23 0.5 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C I 30 0.25 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 20 8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E S 23 16 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F S 29 8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G I 19 1 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 28 0.5 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I I 28 2 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J R 21 4 &gt;=16</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" and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "tobr"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.07399410 -0.03958601 0.56084503 0.09513514 -0.24454184 0.30038844</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.31486005 -0.91854813 0.11340013 0.37377319</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.65740570 -0.67731621 -0.39965959 0.52521431 0.54359791 0.52536651</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.78240570 0.12784483 0.09866131 0.69610233</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"><a href="https://tidyselect.r-lib.org/reference/where.html" class="external-link">where</a></span><span class="op">(</span><span class="va">is.mic</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-err co"><span class="r-pr">#&gt;</span> <span class="error">Error in .subset(x, j):</span> invalid subscript type 'list'</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>
@ -265,17 +265,17 @@
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Calculating mean AMR distance based on columns "amox", "cipr", "gent" and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "tobr"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C I 27 4 16 0.56084503 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J I 31 4 2 0.37377319 0.1870718</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 F I 30 2 4 0.30038844 0.2604566</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 I R 27 1 &lt;=0.5 0.11340013 0.4474449</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 D R 30 0.25 1 0.09513514 0.4657099</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 A R 22 0.25 8 0.07399410 0.4868509</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 B I 26 2 2 -0.03958601 0.6004310</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 E S 17 2 8 -0.24454184 0.8053869</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 G S 19 0.5 16 -0.31486005 0.8757051</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 H I 23 0.25 &lt;=0.5 -0.91854813 1.4793932</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 I 30 0.25 0.5 -0.39965959 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 A S 19 2 0.5 -0.65740570 0.2577461</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 B I 23 0.5 0.5 -0.67731621 0.2776566</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 G I 19 1 0.5 -0.78240570 0.3827461</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 I I 28 2 2 0.09866131 0.4983209</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 H R 28 0.5 0.5 0.12784483 0.5275044</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 D R 20 8 4 0.52521431 0.9248739</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 F S 29 8 4 0.52536651 0.9250261</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 E S 23 16 &gt;=16 0.54359791 0.9432575</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J R 21 4 &gt;=16 0.69610233 1.0957619</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

Binary file not shown.

Before

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

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -193,43 +193,42 @@
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1 0.025 0.25 &gt;=128 0.005 0.125 0.01 32 0.01 8 0.002 32 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 4 4 0.01 4 0.01 16 0.025 0.5 0.002 0.25 0.001 64 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &gt;=64 16 0.25 0.5 16 2 0.125 0.125 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.125 0.0625 16 &lt;=0.001 &lt;=0.001 &gt;=64 32 0.01 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 1 &gt;=64 0.005 4 1 0.01 32 </span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 45 43 50 33 10 21 20 26 34 15 43 40 36 46 30 50 46 31 50 44 28 42 19 10 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 25 43 6 40 45 43 47 21 21 35 44 19 41 11 20 25 39 16 47 35 49 40 12 6</span>
<span class="r-in"><span><span class="fu">random_sir</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 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] R S R I I S S R I R S R I R S S S S R S S I S R I</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] R I R I S R S I R I S R R S R R R I I S S R S I R</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
<span class="r-in"><span><span class="co"># make the random generation more realistic by setting a bug and/or drug:</span></span></span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 0.0625-64</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.25 16 0.5 64 0.25 &gt;=128 4 1 &gt;=128 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 1 32 0.005 0.002 2 0.5 64 32 0.0625 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] &lt;=0.001 &gt;=128 0.002 0.005 4 64 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.125 128 4 0.001 0.002 128 0.01 0.025 0.002 0.005 2 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 8 0.025 0.002 4 1 0.5 16 0.005 64 1 16 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.5 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-16</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 32 32 1 0.5 1 1 1 4 32 0.5 8 64 1 64 64 4 1 4 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] 2 2 4 32 1 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 8 4 4 2 &gt;=16 8 &gt;=16 4 8 2 2 &lt;=1 4 &lt;=1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [16] &lt;=1 &lt;=1 8 4 &gt;=16 &gt;=16 2 &lt;=1 8 2 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Streptococcus pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-4</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.25 0.125 0.25 0.125 0.5 0.5 0.25 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 2 0.25 0.5 &lt;=0.0625 0.25 0.125 &lt;=0.0625 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.125 0.125 4 0.25 0.5 0.125 1 0.5 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 4 0.25 4 0.025 0.5 2 &gt;=8 4 0.5 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.25 0.025 &gt;=8 0.5 0.5 0.025 0.125 0.0625 1 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.25 4 1 1 0.125 </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 8-50</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 38 25 42 21 30 49 29 14 31 23 20 45 21 19 50 32 16 41 43 23 9 27 22 28</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 20 33 33 26 20 49 22 12 42 40 29 45 42 48 30 50 37 21 27 50 50 43 49 46</span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"ampicillin"</span><span class="op">)</span> <span class="co"># range 11-17</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 12 16 17 11 12 17 17 15 15 16 17 15 14 16 15 16 17 13 15 14 13 12 13 15 12</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 14 13 13 16 16 11 12 15 14 11 14 15 11 12 11 13 15 13 17 17 16 11 13 11 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-out co"><span class="r-pr">#&gt;</span> Class 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 17 25 24 20 19 17 16 23 24 23 23 25 26 25 26 19 17 23 17 25 19 19 23 20 25</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 27 16 21 16 18 26 19 21 19 18 16 19 17 18 19 21 18 23 26 25 18 19 24 23 22</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>

View File

@ -10,7 +10,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@ -12,7 +12,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9120</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9121</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -181,7 +181,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">skewness</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Uniform.html" class="external-link">runif</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.03042828</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.007664284</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

Some files were not shown because too many files have changed in this diff Show More