mirror of
https://github.com/msberends/AMR.git
synced 2024-12-27 10:06:12 +01:00
Built site for AMR: 2.0.0.9041@08f7256
This commit is contained in:
parent
be8832a827
commit
9bc1b49ea6
@ -402,18 +402,18 @@ names or codes, this would have worked exactly the same way:</p>
|
|||||||
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span></span>
|
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span></span>
|
||||||
<span><span class="co">#> rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
|
<span><span class="co">#> rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></span>
|
||||||
<span><span class="co">#> 1 R I R S R S</span></span>
|
<span><span class="co">#> 1 S S I R R S</span></span>
|
||||||
<span><span class="co">#> 2 R S I S S S</span></span>
|
<span><span class="co">#> 2 S R I S S I</span></span>
|
||||||
<span><span class="co">#> 3 R R I R I R</span></span>
|
<span><span class="co">#> 3 S S I S R R</span></span>
|
||||||
<span><span class="co">#> 4 I S I R R I</span></span>
|
<span><span class="co">#> 4 I S R I S I</span></span>
|
||||||
<span><span class="co">#> 5 R I R I R S</span></span>
|
<span><span class="co">#> 5 I I R S R I</span></span>
|
||||||
<span><span class="co">#> 6 I I I I S I</span></span>
|
<span><span class="co">#> 6 R S I I R I</span></span>
|
||||||
<span><span class="co">#> kanamycin</span></span>
|
<span><span class="co">#> kanamycin</span></span>
|
||||||
<span><span class="co">#> 1 S</span></span>
|
<span><span class="co">#> 1 I</span></span>
|
||||||
<span><span class="co">#> 2 I</span></span>
|
<span><span class="co">#> 2 I</span></span>
|
||||||
<span><span class="co">#> 3 S</span></span>
|
<span><span class="co">#> 3 S</span></span>
|
||||||
<span><span class="co">#> 4 I</span></span>
|
<span><span class="co">#> 4 S</span></span>
|
||||||
<span><span class="co">#> 5 S</span></span>
|
<span><span class="co">#> 5 R</span></span>
|
||||||
<span><span class="co">#> 6 I</span></span></code></pre></div>
|
<span><span class="co">#> 6 I</span></span></code></pre></div>
|
||||||
<p>We can now add the interpretation of MDR-TB to our data set. You can
|
<p>We can now add the interpretation of MDR-TB to our data set. You can
|
||||||
use:</p>
|
use:</p>
|
||||||
@ -455,40 +455,40 @@ Unique: 5</p>
|
|||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td align="left">1</td>
|
<td align="left">1</td>
|
||||||
<td align="left">Mono-resistant</td>
|
<td align="left">Mono-resistant</td>
|
||||||
<td align="right">3216</td>
|
<td align="right">3189</td>
|
||||||
<td align="right">64.32%</td>
|
<td align="right">63.78%</td>
|
||||||
<td align="right">3216</td>
|
<td align="right">3189</td>
|
||||||
<td align="right">64.32%</td>
|
<td align="right">63.78%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td align="left">2</td>
|
<td align="left">2</td>
|
||||||
<td align="left">Negative</td>
|
<td align="left">Negative</td>
|
||||||
<td align="right">988</td>
|
<td align="right">986</td>
|
||||||
<td align="right">19.76%</td>
|
<td align="right">19.72%</td>
|
||||||
<td align="right">4204</td>
|
<td align="right">4175</td>
|
||||||
<td align="right">84.08%</td>
|
<td align="right">83.50%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td align="left">3</td>
|
<td align="left">3</td>
|
||||||
<td align="left">Multi-drug-resistant</td>
|
<td align="left">Multi-drug-resistant</td>
|
||||||
<td align="right">464</td>
|
<td align="right">454</td>
|
||||||
<td align="right">9.28%</td>
|
<td align="right">9.08%</td>
|
||||||
<td align="right">4668</td>
|
<td align="right">4629</td>
|
||||||
<td align="right">93.36%</td>
|
<td align="right">92.58%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td align="left">4</td>
|
<td align="left">4</td>
|
||||||
<td align="left">Poly-resistant</td>
|
<td align="left">Poly-resistant</td>
|
||||||
<td align="right">235</td>
|
<td align="right">255</td>
|
||||||
<td align="right">4.70%</td>
|
<td align="right">5.10%</td>
|
||||||
<td align="right">4903</td>
|
<td align="right">4884</td>
|
||||||
<td align="right">98.06%</td>
|
<td align="right">97.68%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td align="left">5</td>
|
<td align="left">5</td>
|
||||||
<td align="left">Extensively drug-resistant</td>
|
<td align="left">Extensively drug-resistant</td>
|
||||||
<td align="right">97</td>
|
<td align="right">116</td>
|
||||||
<td align="right">1.94%</td>
|
<td align="right">2.32%</td>
|
||||||
<td align="right">5000</td>
|
<td align="right">5000</td>
|
||||||
<td align="right">100.00%</td>
|
<td align="right">100.00%</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -307,7 +307,7 @@ function:</p>
|
|||||||
<span><span class="co">#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"</span></span>
|
<span><span class="co">#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"</span></span>
|
||||||
<span><span class="co">#> Importance of components:</span></span>
|
<span><span class="co">#> Importance of components:</span></span>
|
||||||
<span><span class="co">#> PC1 PC2 PC3 PC4 PC5 PC6 PC7</span></span>
|
<span><span class="co">#> PC1 PC2 PC3 PC4 PC5 PC6 PC7</span></span>
|
||||||
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 1.232e-16</span></span>
|
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 9.577e-17</span></span>
|
||||||
<span><span class="co">#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00</span></span>
|
<span><span class="co">#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00</span></span>
|
||||||
<span><span class="co">#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00</span></span></code></pre></div>
|
<span><span class="co">#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00</span></span></code></pre></div>
|
||||||
<pre><code><span><span class="co">#> Groups (n=4, named as 'order'):</span></span>
|
<pre><code><span><span class="co">#> Groups (n=4, named as 'order'):</span></span>
|
||||||
|
@ -11,7 +11,7 @@ articles:
|
|||||||
other_pkg: other_pkg.html
|
other_pkg: other_pkg.html
|
||||||
resistance_predict: resistance_predict.html
|
resistance_predict: resistance_predict.html
|
||||||
welcome_to_AMR: welcome_to_AMR.html
|
welcome_to_AMR: welcome_to_AMR.html
|
||||||
last_built: 2023-07-13T08:47Z
|
last_built: 2023-07-13T11:49Z
|
||||||
urls:
|
urls:
|
||||||
reference: https://msberends.github.io/AMR/reference
|
reference: https://msberends.github.io/AMR/reference
|
||||||
article: https://msberends.github.io/AMR/articles
|
article: https://msberends.github.io/AMR/articles
|
||||||
|
@ -222,16 +222,16 @@
|
|||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="va">df</span></span></span>
|
<span class="r-in"><span><span class="va">df</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> birth_date age age_exact age_at_y2k</span>
|
<span class="r-out co"><span class="r-pr">#></span> birth_date age age_exact age_at_y2k</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 1 1974-07-20 48 48.98082 25</span>
|
<span class="r-out co"><span class="r-pr">#></span> 1 1974-05-02 49 49.19726 25</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 2 1985-06-21 38 38.06027 14</span>
|
<span class="r-out co"><span class="r-pr">#></span> 2 1970-02-15 53 53.40548 29</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 3 1985-06-04 38 38.10685 14</span>
|
<span class="r-out co"><span class="r-pr">#></span> 3 1936-11-01 86 86.69589 63</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 4 1942-11-20 80 80.64384 57</span>
|
<span class="r-out co"><span class="r-pr">#></span> 4 1986-10-02 36 36.77808 13</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 5 1958-04-27 65 65.21096 41</span>
|
<span class="r-out co"><span class="r-pr">#></span> 5 1948-11-26 74 74.62740 51</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 6 1942-12-21 80 80.55890 57</span>
|
<span class="r-out co"><span class="r-pr">#></span> 6 1982-06-24 41 41.05205 17</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 7 1960-02-09 63 63.42192 39</span>
|
<span class="r-out co"><span class="r-pr">#></span> 7 1996-04-04 27 27.27397 3</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 8 1968-07-27 54 54.96164 31</span>
|
<span class="r-out co"><span class="r-pr">#></span> 8 1935-03-13 88 88.33425 64</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 9 1980-11-10 42 42.67123 19</span>
|
<span class="r-out co"><span class="r-pr">#></span> 9 1939-06-15 84 84.07671 60</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> 10 1953-04-23 70 70.22192 46</span>
|
<span class="r-out co"><span class="r-pr">#></span> 10 1935-01-02 88 88.52603 64</span>
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
</div>
|
</div>
|
||||||
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
||||||
|
@ -626,10 +626,10 @@ In short, if you have a column name that resembles an antimicrobial drug, it wil
|
|||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 5 × 1</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 5 × 1</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> kefzol</span>
|
<span class="r-out co"><span class="r-pr">#></span> kefzol</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><sir></span> </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><sir></span> </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> S </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> R </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> R </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> R </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> S </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> I </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> I </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> S </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> R </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> R </span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||||
|
@ -567,19 +567,19 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
|
|||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 13 × 13</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 13 × 13</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> datetime index ab_user mo_user ab mo input</span>
|
<span class="r-out co"><span class="r-pr">#></span> datetime index ab_user mo_user ab mo input</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dttm></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dttm></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 2023-07-13 <span style="color: #949494;">08:48:10</span> 1 TOB Escherich… TOB B_[ORD]_ENTRBCTR 16 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 2023-07-13 <span style="color: #949494;">11:50:09</span> 1 TOB Escherich… TOB B_[ORD]_ENTRBCTR 16 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 2023-07-13 <span style="color: #949494;">08:48:10</span> 1 GEN Escherich… GEN B_[ORD]_ENTRBCTR 18 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 2023-07-13 <span style="color: #949494;">11:50:09</span> 1 GEN Escherich… GEN B_[ORD]_ENTRBCTR 18 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 2023-07-13 <span style="color: #949494;">08:48:10</span> 1 CIP Escherich… CIP B_[ORD]_ENTRBCTR 0.256</span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 2023-07-13 <span style="color: #949494;">11:50:09</span> 1 CIP Escherich… CIP B_[ORD]_ENTRBCTR 0.256</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 2023-07-13 <span style="color: #949494;">08:48:10</span> 1 AMP Escherich… AMP B_[ORD]_ENTRBCTR 8 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 2023-07-13 <span style="color: #949494;">11:50:09</span> 1 AMP Escherich… AMP B_[ORD]_ENTRBCTR 8 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 2023-07-13 <span style="color: #949494;">08:48:01</span> 1 AMX B_STRPT_P… AMX B_STRPT_PNMN 0.01 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 1 AMX B_STRPT_P… AMX B_STRPT_PNMN 0.01 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 2023-07-13 <span style="color: #949494;">08:48:01</span> 2 AMX B_STRPT_P… AMX B_STRPT_PNMN 2 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 2 AMX B_STRPT_P… AMX B_STRPT_PNMN 2 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 2023-07-13 <span style="color: #949494;">08:48:01</span> 3 AMX B_STRPT_P… AMX B_STRPT_PNMN 4 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 3 AMX B_STRPT_P… AMX B_STRPT_PNMN 4 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 2023-07-13 <span style="color: #949494;">08:48:01</span> 4 AMX B_STRPT_P… AMX B_STRPT_PNMN 8 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 4 AMX B_STRPT_P… AMX B_STRPT_PNMN 8 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 2023-07-13 <span style="color: #949494;">08:48:00</span> 1 AMX B_STRPT_P… AMX B_STRPT_PNMN 2 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 1 AMX B_STRPT_P… AMX B_STRPT_PNMN 2 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 2023-07-13 <span style="color: #949494;">08:48:00</span> 1 TOB Escherich… TOB B_[ORD]_ENTRBCTR 16 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 1 TOB Escherich… TOB B_[ORD]_ENTRBCTR 16 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">11</span> 2023-07-13 <span style="color: #949494;">08:47:59</span> 1 GEN Escherich… GEN B_[ORD]_ENTRBCTR 18 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">11</span> 2023-07-13 <span style="color: #949494;">11:50:02</span> 1 GEN Escherich… GEN B_[ORD]_ENTRBCTR 18 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">12</span> 2023-07-13 <span style="color: #949494;">08:47:59</span> 1 AMP Escherich… AMP B_[ORD]_ENTRBCTR 20 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">12</span> 2023-07-13 <span style="color: #949494;">11:50:01</span> 1 AMP Escherich… AMP B_[ORD]_ENTRBCTR 20 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">13</span> 2023-07-13 <span style="color: #949494;">08:47:59</span> 1 ampicillin Strep pneu AMP B_STRPT_PNMN 18 </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">13</span> 2023-07-13 <span style="color: #949494;">11:50:01</span> 1 ampicillin Strep pneu AMP B_STRPT_PNMN 18 </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 6 more variables: outcome <sir>, method <chr>, breakpoint_S_R <chr>,</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 6 more variables: outcome <sir>, method <chr>, breakpoint_S_R <chr>,</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># guideline <chr>, ref_table <chr>, uti <lgl></span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># guideline <chr>, ref_table <chr>, uti <lgl></span></span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
|
@ -263,27 +263,28 @@
|
|||||||
<span class="r-in"><span><span class="va">df</span> <span class="op"><-</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 class="va">df</span> <span class="op"><-</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></span>
|
||||||
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
|
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [1] 21 49 50 40 33 47 39 43 8 18 31 32 43 36 17 29 4 17 12 15 50 30 28 33 45</span>
|
<span class="r-out co"><span class="r-pr">#></span> [1] 1 51 42 11 17 37 6 44 43 49 47 34 15 36 12 16 16 10 4 25 2 45 7 29 31</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [26] 12 19 44 22 2 38 2 12 11 46 40 12 46 6 16 7 6 20 26 1 4 37 5 34 35</span>
|
<span class="r-out co"><span class="r-pr">#></span> [26] 14 13 43 46 22 20 11 37 50 30 5 28 8 20 45 24 8 45 45 43 12 38 13 3 17</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [51] 25 50 47 22 14 17 37 12 36 42 36 10 13 48 15 3 15 9 28 7 25 31 20 26 1</span>
|
<span class="r-out co"><span class="r-pr">#></span> [51] 35 50 6 23 28 32 40 4 15 5 7 18 37 6 39 4 40 47 12 9 48 51 22 32 32</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [76] 31 41 13 17 31 22 39 29 27 9 5 27 23 26 13 29 34 37 13 24 33 22 22 40 51</span>
|
<span class="r-out co"><span class="r-pr">#></span> [76] 10 19 21 41 35 18 10 24 40 22 45 26 49 49 33 3 9 49 9 42 27 29 23 16 25</span>
|
||||||
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
|
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [13] FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE FALSE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [13] TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [25] TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [37] FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE TRUE TRUE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [37] TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [49] TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [49] TRUE FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [61] FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [61] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [73] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [73] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE TRUE</span>
|
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE FALSE</span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
|
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
|
||||||
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 1 × 46</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 2 × 46</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> date patient age gender ward mo PEN OXA FLC AMX </span>
|
<span class="r-out co"><span class="r-pr">#></span> date patient age gender ward mo PEN OXA FLC AMX </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2002-06-23 798871 82 M Clinical B_ENTRC_FCLS NA NA NA NA </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2002-10-11 871360 78 M Clinical B_STPHY_EPDR R NA S NA </span>
|
||||||
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2002-08-28 390178 57 M Clinical B_STRPT_SLVR S NA NA S </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,</span></span>
|
||||||
@ -317,19 +318,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="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-in"><span><span class="op">}</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, condition [100]</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, condition [99]</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> patient date condition new_episode</span>
|
<span class="r-out co"><span class="r-pr">#></span> patient date condition new_episode</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 006606 2011-10-30 A TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 008268 2007-02-20 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 011307 2011-09-20 C TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 010257 2004-04-03 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 060287 2007-03-11 B TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 092034 2006-06-12 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 066601 2013-10-30 C TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 0D7D34 2011-03-16 B TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 067927 2002-01-29 A TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 0DBF93 2015-10-12 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 067927 2002-02-05 C TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 105248 2005-06-16 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 078381 2014-07-17 A TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 144280 2002-12-14 C TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 0DBB93 2003-10-01 A TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 144280 2002-12-14 C FALSE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 0E2483 2007-05-29 A TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 189363 2004-06-22 A TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 113236 2006-11-21 B TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 195736 2008-08-28 C TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||||
@ -343,19 +344,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="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-in"><span><span class="op">}</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 5</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 5</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: ward, patient [94]</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: ward, patient [97]</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> ward date patient new_index new_logical</span>
|
<span class="r-out co"><span class="r-pr">#></span> ward date patient new_index new_logical</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> Clinical 2011-10-30 006606 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> ICU 2007-02-20 008268 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Clinical 2011-09-20 011307 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Clinical 2004-04-03 010257 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> Clinical 2007-03-11 060287 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> ICU 2006-06-12 092034 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> Clinical 2013-10-30 066601 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> ICU 2011-03-16 0D7D34 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> ICU 2002-01-29 067927 1 FALSE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> Clinical 2015-10-12 0DBF93 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> ICU 2002-02-05 067927 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> Clinical 2005-06-16 105248 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> ICU 2014-07-17 078381 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> Clinical 2002-12-14 144280 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Clinical 2003-10-01 0DBB93 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Clinical 2002-12-14 144280 1 FALSE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Clinical 2007-05-29 0E2483 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Clinical 2004-06-22 189363 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Clinical 2006-11-21 113236 1 TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Outpatient 2008-08-28 195736 1 TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||||
@ -371,9 +372,9 @@
|
|||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
|
<span class="r-out co"><span class="r-pr">#></span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 52 11 32 42</span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 64 13 40 51</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 34 12 27 31</span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 27 9 22 23</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 8 6 8 8</span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 6 4 5 6</span>
|
||||||
<span class="r-in"><span></span></span>
|
<span class="r-in"><span></span></span>
|
||||||
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
|
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
|
||||||
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
|
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
|
||||||
@ -402,19 +403,19 @@
|
|||||||
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
|
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
|
||||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, mo, ward [97]</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, mo, ward [98]</span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> patient mo ward flag_episode</span>
|
<span class="r-out co"><span class="r-pr">#></span> patient mo ward flag_episode</span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 207752 B_ESCHR_COLI ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 496896 B_ESCHR_COLI ICU TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> D80438 B_CRYNB_STRT ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> A22289 B_PSDSC_VLNR ICU TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 12CB58 B_STPHY_EPDR ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 438196 B_STPHY_COHN Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> A56264 B_STPHY_CPTS ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 189363 B_STPHY_AURS Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 5B78D5 B_STPHY_AURS Clinical TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> F14947 B_STPHY_CONS Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 59F400 B_STRPT_PNMN ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 298662 B_ESCHR_COLI Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 2F9056 B_HAFNI_ALVE ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> B82C75 B_STPHY_CONS Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 208305 B_PROTS_MRBL Clinical TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 384779 B_STRPT_PNMN Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 734274 B_MRGNL_MRGN ICU TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> D60054 B_STPHY_EPDR Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 403631 B_ESCHR_COLI Clinical TRUE </span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 5CD352 B_MCRCCC_LUTS Clinical TRUE </span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
|
@ -199,9 +199,9 @@
|
|||||||
<div class="section level2">
|
<div class="section level2">
|
||||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
|
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [1] 2.947971</span>
|
<span class="r-out co"><span class="r-pr">#></span> [1] 2.986848</span>
|
||||||
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.03641562</span>
|
<span class="r-out co"><span class="r-pr">#></span> [1] -0.05074186</span>
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
</div>
|
</div>
|
||||||
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
||||||
|
@ -198,7 +198,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
|
|||||||
<div class="section level2">
|
<div class="section level2">
|
||||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">skewness</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Uniform.html" class="external-link">runif</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span><span class="op">)</span></span></span>
|
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">skewness</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Uniform.html" class="external-link">runif</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.06066287</span>
|
<span class="r-out co"><span class="r-pr">#></span> [1] -0.1177522</span>
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
</div>
|
</div>
|
||||||
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user