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

Built site for AMR: 2.0.0@68aa98f

This commit is contained in:
github-actions 2023-03-12 15:05:25 +00:00
parent cb279602b6
commit e72c161f5f
29 changed files with 266 additions and 268 deletions

View File

@ -962,110 +962,110 @@ antibiograms:</p>
<tr class="odd">
<td align="left">Cardial</td>
<td align="left">
<em>E. coli</em> (415-415)</td>
<td align="right">64</td>
<td align="right">58</td>
<td align="right">56</td>
<td align="right">63</td>
<em>E. coli</em> (431-431)</td>
<td align="right">65</td>
<td align="right">57</td>
<td align="right">55</td>
<td align="right">62</td>
</tr>
<tr class="even">
<td align="left">Respiratory</td>
<td align="left">
<em>E. coli</em> (432-432)</td>
<td align="right">64</td>
<td align="right">59</td>
<td align="right">58</td>
<em>E. coli</em> (411-411)</td>
<td align="right">62</td>
<td align="right">56</td>
<td align="right">58</td>
<td align="right">61</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">
<em>E. coli</em> (403-403)</td>
<td align="right">63</td>
<td align="right">58</td>
<td align="right">59</td>
<td align="right">63</td>
<em>E. coli</em> (408-408)</td>
<td align="right">65</td>
<td align="right">62</td>
<td align="right">61</td>
<td align="right">66</td>
</tr>
<tr class="even">
<td align="left">Cardial</td>
<td align="left">
<em>K. pneumoniae</em> (98-98)</td>
<td align="right">66</td>
<td align="right">44</td>
<td align="right">64</td>
<em>K. pneumoniae</em> (100-100)</td>
<td align="right">63</td>
<td align="right">50</td>
<td align="right">59</td>
<td align="right">62</td>
</tr>
<tr class="odd">
<td align="left">Respiratory</td>
<td align="left">
<em>K. pneumoniae</em> (110-110)</td>
<em>K. pneumoniae</em> (108-108)</td>
<td align="right">65</td>
<td align="right">61</td>
<td align="right">59</td>
<td align="right">59</td>
<td align="right">56</td>
<td align="right">64</td>
<td align="right">62</td>
</tr>
<tr class="even">
<td align="left">Rheumatic</td>
<td align="left">
<em>K. pneumoniae</em> (108-108)</td>
<td align="right">57</td>
<td align="right">61</td>
<td align="right">52</td>
<td align="right">54</td>
<td align="right">59</td>
<td align="right">56</td>
</tr>
<tr class="odd">
<td align="left">Cardial</td>
<td align="left">
<em>S. aureus</em> (212-212)</td>
<em>S. aureus</em> (211-211)</td>
<td align="right">64</td>
<td align="right">52</td>
<td align="right">61</td>
<td align="right">61</td>
<td align="right">53</td>
<td align="right">51</td>
<td align="right">59</td>
</tr>
<tr class="even">
<td align="left">Respiratory</td>
<td align="left">
<em>S. aureus</em> (236-236)</td>
<td align="right">68</td>
<td align="right">62</td>
<td align="right">64</td>
<td align="right">65</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">
<em>S. aureus</em> (213-213)</td>
<em>S. aureus</em> (226-226)</td>
<td align="right">63</td>
<td align="right">55</td>
<td align="right">56</td>
<td align="right">64</td>
<td align="right">58</td>
<td align="right">54</td>
<td align="right">60</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">
<em>S. aureus</em> (224-224)</td>
<td align="right">67</td>
<td align="right">60</td>
<td align="right">57</td>
<td align="right">68</td>
</tr>
<tr class="even">
<td align="left">Cardial</td>
<td align="left">
<em>S. pneumoniae</em> (131-131)</td>
<td align="right">69</td>
<em>S. pneumoniae</em> (121-121)</td>
<td align="right">67</td>
<td align="right">56</td>
<td align="right">66</td>
<td align="right">71</td>
<td align="right">53</td>
<td align="right">60</td>
</tr>
<tr class="odd">
<td align="left">Respiratory</td>
<td align="left">
<em>S. pneumoniae</em> (146-146)</td>
<em>S. pneumoniae</em> (128-128)</td>
<td align="right">59</td>
<td align="right">54</td>
<td align="right">59</td>
<td align="right">62</td>
<td align="right">55</td>
<td align="right">57</td>
<td align="right">67</td>
</tr>
<tr class="even">
<td align="left">Rheumatic</td>
<td align="left">
<em>S. pneumoniae</em> (122-122)</td>
<td align="right">61</td>
<em>S. pneumoniae</em> (150-150)</td>
<td align="right">66</td>
<td align="right">57</td>
<td align="right">57</td>
<td align="right">58</td>
<td align="right">65</td>
<td align="right">73</td>
</tr>
</tbody>
</table>
@ -1090,45 +1090,45 @@ antibiograms:</p>
<tbody>
<tr class="odd">
<td align="left">Cardial</td>
<td align="left">Gram-negative (513-513)</td>
<td align="right">65</td>
<td align="right">55</td>
<td align="right">63</td>
<td align="left">Gram-negative (531-531)</td>
<td align="right">64</td>
<td align="right">56</td>
<td align="right">62</td>
</tr>
<tr class="even">
<td align="left">Respiratory</td>
<td align="left">Gram-negative (542-542)</td>
<td align="right">64</td>
<td align="right">60</td>
<td align="right">62</td>
<td align="left">Gram-negative (519-519)</td>
<td align="right">63</td>
<td align="right">56</td>
<td align="right">61</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">Gram-negative (511-511)</td>
<td align="right">62</td>
<td align="right">57</td>
<td align="right">62</td>
<td align="left">Gram-negative (516-516)</td>
<td align="right">64</td>
<td align="right">59</td>
<td align="right">64</td>
</tr>
<tr class="even">
<td align="left">Cardial</td>
<td align="left">Gram-positive (343-343)</td>
<td align="right">64</td>
<td align="left">Gram-positive (332-332)</td>
<td align="right">65</td>
<td align="right">54</td>
<td align="right">64</td>
<td align="right">61</td>
</tr>
<tr class="odd">
<td align="left">Respiratory</td>
<td align="left">Gram-positive (382-382)</td>
<td align="right">66</td>
<td align="right">59</td>
<td align="right">66</td>
<td align="left">Gram-positive (354-354)</td>
<td align="right">61</td>
<td align="right">56</td>
<td align="right">60</td>
</tr>
<tr class="even">
<td align="left">Rheumatic</td>
<td align="left">Gram-positive (335-335)</td>
<td align="right">63</td>
<td align="right">56</td>
<td align="right">62</td>
<td align="left">Gram-positive (374-374)</td>
<td align="right">66</td>
<td align="right">59</td>
<td align="right">70</td>
</tr>
</tbody>
</table>
@ -1152,45 +1152,45 @@ antibiograms:</p>
<tbody>
<tr class="odd">
<td align="left">Cardial</td>
<td align="left">Gram-negative (513-513)</td>
<td align="right">65</td>
<td align="right">76</td>
<td align="right">75</td>
</tr>
<tr class="even">
<td align="left">Respiratory</td>
<td align="left">Gram-negative (542-542)</td>
<td align="left">Gram-negative (531-531)</td>
<td align="right">64</td>
<td align="right">76</td>
<td align="right">76</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">Gram-negative (511-511)</td>
<td align="right">62</td>
<td align="right">76</td>
<td align="right">75</td>
<td align="right">74</td>
</tr>
<tr class="even">
<td align="left">Cardial</td>
<td align="left">Gram-positive (343-343)</td>
<td align="left">Respiratory</td>
<td align="left">Gram-negative (519-519)</td>
<td align="right">63</td>
<td align="right">75</td>
<td align="right">74</td>
</tr>
<tr class="odd">
<td align="left">Rheumatic</td>
<td align="left">Gram-negative (516-516)</td>
<td align="right">64</td>
<td align="right">75</td>
<td align="right">75</td>
<td align="right">78</td>
<td align="right">77</td>
</tr>
<tr class="even">
<td align="left">Cardial</td>
<td align="left">Gram-positive (332-332)</td>
<td align="right">65</td>
<td align="right">79</td>
<td align="right">74</td>
</tr>
<tr class="odd">
<td align="left">Respiratory</td>
<td align="left">Gram-positive (382-382)</td>
<td align="right">66</td>
<td align="right">80</td>
<td align="right">79</td>
<td align="left">Gram-positive (354-354)</td>
<td align="right">61</td>
<td align="right">75</td>
<td align="right">72</td>
</tr>
<tr class="even">
<td align="left">Rheumatic</td>
<td align="left">Gram-positive (335-335)</td>
<td align="right">63</td>
<td align="right">76</td>
<td align="right">73</td>
<td align="left">Gram-positive (374-374)</td>
<td align="right">66</td>
<td align="right">79</td>
<td align="right">80</td>
</tr>
</tbody>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -385,17 +385,17 @@ 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">#&gt; rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
<span><span class="co">#&gt; 1 R R I R R I</span></span>
<span><span class="co">#&gt; 2 S R S S I I</span></span>
<span><span class="co">#&gt; 3 S S I R S S</span></span>
<span><span class="co">#&gt; 4 S I S S R I</span></span>
<span><span class="co">#&gt; 5 R I I S S I</span></span>
<span><span class="co">#&gt; 6 I R R I I I</span></span>
<span><span class="co">#&gt; 1 I R S I S R</span></span>
<span><span class="co">#&gt; 2 R S R S S I</span></span>
<span><span class="co">#&gt; 3 R I I I S S</span></span>
<span><span class="co">#&gt; 4 S I S I R S</span></span>
<span><span class="co">#&gt; 5 R S S I S R</span></span>
<span><span class="co">#&gt; 6 S S S I I S</span></span>
<span><span class="co">#&gt; kanamycin</span></span>
<span><span class="co">#&gt; 1 S</span></span>
<span><span class="co">#&gt; 2 I</span></span>
<span><span class="co">#&gt; 3 I</span></span>
<span><span class="co">#&gt; 4 R</span></span>
<span><span class="co">#&gt; 3 R</span></span>
<span><span class="co">#&gt; 4 S</span></span>
<span><span class="co">#&gt; 5 S</span></span>
<span><span class="co">#&gt; 6 I</span></span></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can
@ -438,40 +438,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3189</td>
<td align="right">63.78%</td>
<td align="right">3189</td>
<td align="right">63.78%</td>
<td align="right">3232</td>
<td align="right">64.64%</td>
<td align="right">3232</td>
<td align="right">64.64%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">1007</td>
<td align="right">20.14%</td>
<td align="right">4196</td>
<td align="right">83.92%</td>
<td align="right">952</td>
<td align="right">19.04%</td>
<td align="right">4184</td>
<td align="right">83.68%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">464</td>
<td align="right">9.28%</td>
<td align="right">4660</td>
<td align="right">93.20%</td>
<td align="right">465</td>
<td align="right">9.30%</td>
<td align="right">4649</td>
<td align="right">92.98%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">242</td>
<td align="right">4.84%</td>
<td align="right">4902</td>
<td align="right">98.04%</td>
<td align="right">248</td>
<td align="right">4.96%</td>
<td align="right">4897</td>
<td align="right">97.94%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">98</td>
<td align="right">1.96%</td>
<td align="right">103</td>
<td align="right">2.06%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

View File

@ -52,7 +52,7 @@ $(document).ready(function() {
// add doctoral titles to authors
function doct_tit(x) {
if (typeof(x) != "undefined") {
x = x.replace(/Author, maintainer/g, "Principle maintainer");
x = x.replace(/Author, maintainer/g, "Principal maintainer");
x = x.replace(/Author, contributor/g, "Contributing maintainer");
x = x.replace(/Thesis advisor/g, "(former) Doctoral advisor");
// contributors

View File

@ -142,7 +142,7 @@
</div>
<div class="section level2">
<h2 class="pkg-version" data-toc-text="2.0.0" id="amr-200">AMR 2.0.0<a class="anchor" aria-label="anchor" href="#amr-200"></a></h2>
<h2 class="pkg-version" data-toc-text="2.0.0" id="amr-200">AMR 2.0.0<a class="anchor" aria-label="anchor" href="#amr-200"></a></h2><p class="text-muted">CRAN release: 2023-03-12</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>
<ul><li>All functions and arguments with rsi were replaced with sir, such as the interpretation of MIC values (now <code><a href="../reference/as.sir.html">as.sir()</a></code> instead of <code><a href="../reference/AMR-deprecated.html">as.rsi()</a></code>) - all old functions still work for now</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-03-12T13:11Z
last_built: 2023-03-12T15:02Z
urls:
reference: https://msberends.github.io/AMR/reference
article: https://msberends.github.io/AMR/articles

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

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

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -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 1967-01-30 56 56.11233 32</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1995-12-14 27 27.24110 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1956-04-27 66 66.87397 43</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1996-08-19 26 26.56164 3</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1980-07-28 42 42.62192 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1973-05-23 49 49.80274 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1988-08-12 34 34.58082 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1959-02-23 64 64.04658 40</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1974-04-16 48 48.90411 25</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1956-12-27 66 66.20548 43</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1934-11-22 88 88.30137 65</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1994-03-10 29 29.00548 5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1958-07-03 64 64.69041 41</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1981-12-16 41 41.23562 18</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1962-04-09 60 60.92329 37</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1992-02-23 31 31.04658 7</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1931-10-27 91 91.37260 68</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1938-03-18 84 84.98356 61</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1988-06-05 34 34.76712 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1958-09-19 64 64.47671 41</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -611,9 +611,9 @@ In short, if you have a column name that resembles an antimicrobial drug, it wil
<span class="r-out co"><span class="r-pr">#&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> I </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> S </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> S </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> S </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> I </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># get AMR for all aminoglycosides e.g., per ward:</span></span></span>

View File

@ -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-03-12 <span style="color: #949494;">13:11:56</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-03-12 <span style="color: #949494;">13:11:55</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-03-12 <span style="color: #949494;">13:11:55</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-03-12 <span style="color: #949494;">13:11:55</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">13:11:50</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-03-12 <span style="color: #949494;">15:03:10</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-03-12 <span style="color: #949494;">15:03:09</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-03-12 <span style="color: #949494;">15:03:09</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-03-12 <span style="color: #949494;">15:03:09</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-03-12 <span style="color: #949494;">15:03:04</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-03-12 <span style="color: #949494;">15:03:04</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-03-12 <span style="color: #949494;">15:03:04</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-03-12 <span style="color: #949494;">15:03:04</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-03-12 <span style="color: #949494;">15:03:04</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-03-12 <span style="color: #949494;">15:03:04</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

@ -246,30 +246,28 @@
<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] 8 47 8 11 43 23 7 20 28 46 43 18 13 4 36 8 24 49 8 41 21 9 2 49 37</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 20 23 9 45 1 8 9 41 2 29 6 24 30 25 12 17 9 26 1 6 27 22 34 19 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 38 24 48 43 33 3 14 19 8 24 5 15 3 44 46 39 42 35 23 11 48 7 26 25 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 21 46 43 40 10 1 31 32 3 45 35 7 14 17 16 16 14 19 40 10 24 36 18 7 3</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 47 25 49 16 43 1 35 21 9 29 11 28 27 26 17 42 29 17 27 10 14 12 9 2 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 38 48 47 29 4 25 5 37 4 1 5 33 19 4 50 21 36 46 3 45 20 1 6 16 15</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 11 13 34 31 10 44 18 23 49 46 37 41 2 42 32 50 39 30 7 15 19 21 6 49 9</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 1 32 20 4 8 4 3 23 36 48 24 30 12 40 48 22 35 32 37 29 44 34 13 18 19</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 FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] TRUE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 4 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;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-11-16 762305 87 F Clinical B_BCTRD_FRGL R NA NA R </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-11-16 762305 87 F Clinical B_PROTS_MRBL R NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2002-11-04 304347 62 M Clinical B_STRPT_PNMN S NA NA S </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2002-09-23 F35553 51 M ICU B_STPHY_AURS S NA S NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-11-16 762305 87 F Clinical B_PROTS_MRBL R NA NA NA </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-10-14 FCC668 54 F ICU B_STRPT_PNMN S NA NA S </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>
@ -304,19 +302,19 @@
<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> <span style="color: #949494;"># Groups: patient, condition [100]</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> 006827 2009-07-24 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 010257 2004-04-03 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 023456 2002-02-05 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 067927 2002-01-13 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 0E2483 2007-06-21 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 1435C8 2004-03-03 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 15D386 2004-08-01 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 15D386 2004-09-06 A FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 167474 2008-02-15 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 195736 2008-08-28 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 000090 2003-10-08 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 005088 2007-08-22 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 023456 2009-11-02 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 063988 2006-12-26 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 080086 2010-08-08 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 082622 2014-02-08 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 083080 2010-02-25 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 0D7D34 2011-03-17 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 0E2483 2007-04-06 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 130252 2002-04-08 B 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>
@ -330,19 +328,19 @@
<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 [94]</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 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 2004-04-03 010257 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2002-02-05 023456 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 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU 2007-06-21 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2004-03-03 1435C8 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2004-08-01 15D386 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2004-09-06 15D386 1 FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2008-02-15 167474 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Outpatient 2008-08-28 195736 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [99]</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> ICU 2003-10-08 000090 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2007-08-22 005088 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 2006-12-26 063988 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2010-08-08 080086 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2014-02-08 082622 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2010-02-25 083080 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2011-03-17 0D7D34 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2007-04-06 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2002-04-08 130252 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>
@ -358,9 +356,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 56 12 36 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 31 11 25 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 7 4 5 6</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 59 13 39 48</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 33 11 22 27</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 7 6 7 7</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>
@ -389,19 +387,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 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> 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> 1435C8 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 7D1606 B_VLLNL_PRVL ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> C58921 B_BCTRD_FRGL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 628820 B_ESCHR_COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 3B8892 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> D22254 B_ESCHR_COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 549150 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 43F266 B_STPHY_AURS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 3F562C B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 658640 B_STPHY_AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [99]</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> 784436 B_STPHY_HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 023456 B_KLBSL_PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 694764 B_STPHY_HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> C58675 B_STPHY_AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 900485 B_STRPT_MITS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> B30560 B_STPHY_CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 685398 B_STRPT_ORLS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> A3C336 B_STRPT_PNMN Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D52219 B_STRPT_GRPA ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 0D7D34 F_CANDD 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

@ -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] 3.001502</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.970149</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.00633944</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.08711231</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

View File

@ -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] R R S I R S R R S R</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I S S R S S I S R R</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.7745967 0.7745967 -1.1618950 -1.1618950 0.7745967 -1.1618950</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.7745967 0.7745967 -1.1618950 0.7745967</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.621059 -0.621059 -0.621059 1.449138 -0.621059 -0.621059 -0.621059</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [8] -0.621059 1.449138 1.449138</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] 0.002 0.002 256 0.0625 0.01 0.025 0.002 2 4 0.005 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.002 0.125 0.001 16 16 64 2 16 0.5 0.0625</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] -0.867240328 -0.867240328 2.066590798 -0.008525384 -0.465717781</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [6] -0.237121583 -0.867240328 0.856106358 1.029032707 -0.638644130</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -1.45381664 -0.39257207 -1.63170516 0.85264760 0.85264760 1.20842465</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.31898203 0.85264760 -0.03679502 -0.57046060</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] -0.867240328 -0.867240328 2.066590798 -0.008525384 -0.465717781</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [6] -0.237121583 -0.867240328 0.856106358 1.029032707 -0.638644130</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -1.45381664 -0.39257207 -1.63170516 0.85264760 0.85264760 1.20842465</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.31898203 0.85264760 -0.03679502 -0.57046060</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] 42 21 42 39 44 36 46 41 9 48</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 41 7 31 43 26 15 50 45 50 36</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] 0.42276578 -1.28455756 0.42276578 0.17886245 0.58536800 -0.06504089</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.74797023 0.34146467 -2.26017090 0.91057245</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.4508859 -1.8718595 -0.2322745 0.5875180 -0.5738547 -1.3253312</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.0657302 0.7241500 1.0657302 0.1093057</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 S 27 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B R 20 1 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C R 31 &lt;=0.5 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 23 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 31 2 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 24 &lt;=0.5 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 28 1 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 22 4 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I S 23 8 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 26 4 4</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 25 &gt;=2 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 29 &gt;=2 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 30 &gt;=2 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 22 &gt;=2 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 21 1 0.25</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 28 &gt;=2 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 20 1 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 19 &gt;=2 0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I S 30 1 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J R 27 &gt;=2 0.5</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> and "tobr"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.2706405 -0.6068529 0.2354050 -0.2518529 0.3034383 -0.2313769</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.4976524 0.4511070 -0.3605963 0.2337166</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.65477694 0.24022002 -0.02948384 0.47956157 -0.75261068 0.50188332</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.64696131 -0.67194018 -0.05486954 0.27942371</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",</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> and "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 R 31 &lt;=0.5 2 0.2354050 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J S 26 4 4 0.2337166 0.00168838</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 E R 31 2 &lt;=1 0.3034383 0.06803327</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 H R 22 4 4 0.4511070 0.21570200</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 G R 28 1 4 0.4976524 0.26224741</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 24 &lt;=0.5 2 -0.2313769 0.46678194</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 D S 23 4 2 -0.2518529 0.48725790</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 A S 27 4 &lt;=1 -0.2706405 0.50604549</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I S 23 8 &lt;=1 -0.3605963 0.59600133</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 B R 20 1 &lt;=1 -0.6068529 0.84225790</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 S 30 &gt;=2 0.5 -0.02948384 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 I S 30 1 4 -0.05486954 0.0253857</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 B I 29 &gt;=2 2 0.24022002 0.2697039</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 J R 27 &gt;=2 0.5 0.27942371 0.3089076</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 D R 22 &gt;=2 4 0.47956157 0.5090454</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 28 &gt;=2 1 0.50188332 0.5313672</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 20 1 0.5 -0.64696131 0.6174775</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 19 &gt;=2 0.5 -0.67194018 0.6424563</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 A R 25 &gt;=2 4 0.65477694 0.6842608</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 E R 21 1 0.25 -0.75261068 0.7231268</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

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

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -193,42 +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 256 2 0.125 64 0.5 0.025 &lt;=0.001 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.025 16 0.0625 0.005 32 &lt;=0.001 0.25 2 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 16 128 64 256 32 256 0.005 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.25 8 64 2 32 2 0.01 4 0.005 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.25 0.0625 0.005 8 32 4 4 &gt;=256 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.025 0.025 0.025 &lt;=0.002 4 32 &gt;=256 </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] 12 10 46 48 20 46 12 18 31 21 8 7 24 21 48 48 26 42 40 18 47 7 16 9 9</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 7 23 41 25 42 15 16 30 42 50 7 26 45 23 43 46 32 26 28 50 44 48 37 42 34</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] S R I S R S I R I S R S I I S I R S S I S I R R I</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] R S I I I R S S S R I S S R R R I S R R S R I S 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] 2 32 4 0.25 4 0.5 2 0.5 0.01 0.01 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.001 1 2 2 0.005 0.5 &gt;=256 0.5 16 0.0625</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.002 0.01 0.0625 8 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 32 8 &lt;=0.001 0.01 2 8 0.5 1 128 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.25 0.0625 0.025 4 0.01 0.125 0.25 0.25 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 32 32 0.01 1 0.01 0.25 32 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-16</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 &gt;=16 4 1 8 4 4 &gt;=16 1 4 8 8 &gt;=16 2 &gt;=16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [16] 1 1 1 2 &gt;=16 &gt;=16 8 1 &gt;=16 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 16 64 16 32 64 32 2 2 1 64 8 4 0.5 8 32 8 64 4 32 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] 64 4 4 16 2 1 </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] 4 2 0.0625 0.025 1 0.025 0.125 0.025 0.125 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.5 4 0.025 4 8 2 4 0.5 0.0625 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.025 0.5 &gt;=16 0.125 0.025 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5 2 0.25 0.025 &gt;=16 2 &gt;=16 0.0625 0.125 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.125 1 0.0625 0.125 1 1 0.025 0.5 0.25 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.25 1 0.025 0.0625 0.0625</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] 47 49 49 45 43 38 34 45 32 20 15 23 21 20 46 21 40 46 46 17 24 33 23 40 49</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 26 30 21 13 11 43 45 9 23 49 44 12 30 34 14 30 17 12 30 42 49 43 23 31 45</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] 11 15 15 17 17 15 12 14 16 15 16 12 13 12 13 17 17 13 12 14 13 17 16 17 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 12 16 16 12 11 13 14 15 13 17 11 11 14 16 12 11 15 15 11 14 11 14 13 12 12</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] 27 19 16 24 26 16 22 25 24 24 21 27 17 20 23 18 27 26 15 24 26 22 26 18 24</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 24 25 23 17 21 26 20 19 22 27 23 15 24 19 22 25 26 18 25 21 22 15 23 23 27</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>

View File

@ -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.006901309</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.05333305</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>

File diff suppressed because one or more lines are too long