Browse Source

(v1.3.0) small MIC fix

main
parent
commit
8ff46eefe9
  1. 2
      DESCRIPTION
  2. 4
      R/mic.R
  3. 478
      docs/articles/AMR.html
  4. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  5. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  6. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  7. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  8. 4
      docs/articles/EUCAST.html
  9. 66
      docs/articles/MDR.html
  10. 4
      docs/articles/PCA.html
  11. 4
      docs/articles/SPSS.html
  12. 4
      docs/articles/WHONET.html
  13. 88
      docs/articles/benchmarks.html
  14. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png
  15. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-6-1.png
  16. 4
      docs/articles/resistance_predict.html
  17. 2
      docs/pkgdown.yml
  18. 2
      docs/reference/AMR-deprecated.html
  19. 2
      docs/reference/AMR.html
  20. 2
      docs/reference/WHOCC.html
  21. 2
      docs/reference/WHONET.html
  22. 2
      docs/reference/ab_from_text.html
  23. 2
      docs/reference/ab_property.html
  24. 2
      docs/reference/age.html
  25. 2
      docs/reference/age_groups.html
  26. 2
      docs/reference/antibiotic_class_selectors.html
  27. 2
      docs/reference/antibiotics.html
  28. 2
      docs/reference/as.ab.html
  29. 2
      docs/reference/as.disk.html
  30. 2
      docs/reference/as.mic.html
  31. 2
      docs/reference/as.mo.html
  32. 2
      docs/reference/atc_online.html
  33. 2
      docs/reference/availability.html
  34. 2
      docs/reference/bug_drug_combinations.html
  35. 2
      docs/reference/catalogue_of_life.html
  36. 2
      docs/reference/catalogue_of_life_version.html
  37. 2
      docs/reference/count.html
  38. 2
      docs/reference/eucast_rules.html
  39. 2
      docs/reference/example_isolates.html
  40. 2
      docs/reference/example_isolates_unclean.html
  41. 2
      docs/reference/filter_ab_class.html
  42. 2
      docs/reference/first_isolate.html
  43. 2
      docs/reference/g.test.html
  44. 2
      docs/reference/ggplot_pca.html
  45. 2
      docs/reference/ggplot_rsi.html
  46. 2
      docs/reference/guess_ab_col.html
  47. 2
      docs/reference/join.html
  48. 2
      docs/reference/key_antibiotics.html
  49. 2
      docs/reference/kurtosis.html
  50. 2
      docs/reference/lifecycle.html
  51. 2
      docs/reference/like.html
  52. 2
      docs/reference/mdro.html
  53. 2
      docs/reference/microorganisms.codes.html
  54. 2
      docs/reference/microorganisms.html
  55. 2
      docs/reference/microorganisms.old.html
  56. 2
      docs/reference/mo_property.html
  57. 2
      docs/reference/mo_source.html
  58. 2
      docs/reference/p_symbol.html
  59. 2
      docs/reference/pca.html
  60. 2
      docs/reference/proportion.html
  61. 2
      docs/reference/resistance_predict.html
  62. 2
      docs/reference/skewness.html
  63. 2
      docs/reference/translate.html

2
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 1.3.0
Date: 2020-07-29
Date: 2020-07-30
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

4
R/mic.R

@ -71,8 +71,8 @@ as.mic <- function(x, na.rm = FALSE) { @@ -71,8 +71,8 @@ as.mic <- function(x, na.rm = FALSE) {
# transform => to >= and =< to <=
x <- gsub("=<", "<=", x, fixed = TRUE)
x <- gsub("=>", ">=", x, fixed = TRUE)
# starting dots must start with 0
x <- gsub("^[.]+", "0.", x)
# dots without a leading zero must start with 0
x <- gsub("([^0-9]|^)[.]", "\\10.", x)
# values like "<=0.2560.512" should be 0.512
x <- gsub(".*[.].*[.]", "0.", x)
# remove ending .0

478
docs/articles/AMR.html

@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9037</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0</span>
</span>
</div>
@ -186,7 +186,7 @@ @@ -186,7 +186,7 @@
<h1 data-toc-skip>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">24 July 2020</h4>
<h4 class="date">30 July 2020</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/AMR.Rmd"><code>vignettes/AMR.Rmd</code></a></small>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -195,7 +195,7 @@ @@ -195,7 +195,7 @@
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 24 July 2020.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 30 July 2020.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -226,21 +226,21 @@ @@ -226,21 +226,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2020-07-24</td>
<td align="center">2020-07-30</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="center">2020-07-24</td>
<td align="center">2020-07-30</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
</tr>
<tr class="odd">
<td align="center">2020-07-24</td>
<td align="center">2020-07-30</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -336,68 +336,68 @@ @@ -336,68 +336,68 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2014-06-04</td>
<td align="center">V5</td>
<td align="center">2017-06-10</td>
<td align="center">J6</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2015-09-20</td>
<td align="center">M6</td>
<td align="center">2013-08-26</td>
<td align="center">H10</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2017-05-14</td>
<td align="center">Q6</td>
<td align="center">Hospital C</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">2016-02-09</td>
<td align="center">S7</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-03-12</td>
<td align="center">O3</td>
<td align="center">Hospital D</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">2013-06-27</td>
<td align="center">A5</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2017-12-27</td>
<td align="center">P8</td>
<td align="center">Hospital B</td>
<td align="center">2017-03-03</td>
<td align="center">Q4</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2013-11-30</td>
<td align="center">B10</td>
<td align="center">Hospital B</td>
<td align="center">2015-07-13</td>
<td align="center">I5</td>
<td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
@ -432,16 +432,16 @@ Longest: 1</p> @@ -432,16 +432,16 @@ Longest: 1</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">M</td>
<td align="right">10,487</td>
<td align="right">52.44%</td>
<td align="right">10,487</td>
<td align="right">52.44%</td>
<td align="right">10,312</td>
<td align="right">51.56%</td>
<td align="right">10,312</td>
<td align="right">51.56%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">F</td>
<td align="right">9,513</td>
<td align="right">47.57%</td>
<td align="right">9,688</td>
<td align="right">48.44%</td>
<td align="right">20,000</td>
<td align="right">100.00%</td>
</tr>
@ -481,7 +481,7 @@ Longest: 1</p> @@ -481,7 +481,7 @@ Longest: 1</p>
<span class="co"># NOTE: Using column `bacteria` as input for `col_mo`.</span>
<span class="co"># NOTE: Using column `date` as input for `col_date`.</span>
<span class="co"># NOTE: Using column `patient_id` as input for `col_patient_id`.</span></pre></body></html></div>
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<p>So only 28.2% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb16"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="no">first</span> <span class="kw">==</span> <span class="fl">TRUE</span>)</pre></body></html></div>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -491,7 +491,7 @@ Longest: 1</p> @@ -491,7 +491,7 @@ Longest: 1</p>
<div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient J1, sorted on date:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient Q3, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -507,19 +507,19 @@ Longest: 1</p> @@ -507,19 +507,19 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-08</td>
<td align="center">J1</td>
<td align="center">2010-02-06</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-06-01</td>
<td align="center">J1</td>
<td align="center">2010-04-09</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -529,76 +529,76 @@ Longest: 1</p> @@ -529,76 +529,76 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-21</td>
<td align="center">J1</td>
<td align="center">2010-07-03</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-07-08</td>
<td align="center">J1</td>
<td align="center">2010-07-31</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-29</td>
<td align="center">J1</td>
<td align="center">2010-10-26</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-02-23</td>
<td align="center">J1</td>
<td align="center">2010-12-11</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-02-23</td>
<td align="center">J1</td>
<td align="center">2011-03-20</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-02-28</td>
<td align="center">J1</td>
<td align="center">2011-04-08</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-03-13</td>
<td align="center">J1</td>
<td align="center">2011-04-24</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -606,14 +606,14 @@ Longest: 1</p> @@ -606,14 +606,14 @@ Longest: 1</p>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-05-14</td>
<td align="center">J1</td>
<td align="center">2011-05-08</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
@ -644,106 +644,106 @@ Longest: 1</p> @@ -644,106 +644,106 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-08</td>
<td align="center">J1</td>
<td align="center">2010-02-06</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-06-01</td>
<td align="center">J1</td>
<td align="center">2010-04-09</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-21</td>
<td align="center">J1</td>
<td align="center">2010-07-03</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-07-08</td>
<td align="center">J1</td>
<td align="center">2010-07-31</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-29</td>
<td align="center">J1</td>
<td align="center">2010-10-26</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-02-23</td>
<td align="center">J1</td>
<td align="center">2010-12-11</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-02-23</td>
<td align="center">J1</td>
<td align="center">2011-03-20</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-02-28</td>
<td align="center">J1</td>
<td align="center">2011-04-08</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-03-13</td>
<td align="center">J1</td>
<td align="center">2011-04-24</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -752,23 +752,23 @@ Longest: 1</p> @@ -752,23 +752,23 @@ Longest: 1</p>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-05-14</td>
<td align="center">J1</td>
<td align="center">2011-05-08</td>
<td align="center">Q3</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 7 isolates are flagged. In total, 78.6% of all isolates are marked ‘first weighted’ - 50.2% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 2, now 9 isolates are flagged. In total, 78.8% of all isolates are marked ‘first weighted’ - 50.6% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb19"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</pre></body></html></div>
<p>So we end up with 15,719 isolates for analysis.</p>
<p>So we end up with 15,769 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb20"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data_1st</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(-<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="no">first</span>, <span class="no">keyab</span>))</pre></body></html></div>
@ -788,7 +788,7 @@ Longest: 1</p> @@ -788,7 +788,7 @@ Longest: 1</p>
<col width="5%">
<col width="10%">
<col width="11%">
<col width="8%">
<col width="6%">
<col width="11%">
</colgroup>
<thead><tr class="header">
@ -810,98 +810,98 @@ Longest: 1</p> @@ -810,98 +810,98 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="center">2014-06-04</td>
<td align="center">V5</td>
<td align="center">2017-06-10</td>
<td align="center">J6</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">3</td>
<td align="center">2017-05-14</td>
<td align="center">Q6</td>
<td align="center">Hospital C</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="left">2</td>
<td align="center">2013-08-26</td>
<td align="center">H10</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">4</td>
<td align="center">2017-03-12</td>
<td align="center">O3</td>
<td align="left">3</td>
<td align="center">2016-02-09</td>
<td align="center">S7</td>
<td align="center">Hospital D</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">5</td>
<td align="center">2017-12-27</td>
<td align="center">P8</td>
<td align="left">4</td>
<td align="center">2013-06-27</td>
<td align="center">A5</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">6</td>
<td align="center">2013-11-30</td>
<td align="center">B10</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">I</td>
<td align="left">5</td>
<td align="center">2017-03-03</td>
<td align="center">Q4</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">8</td>
<td align="center">2011-06-14</td>
<td align="center">A2</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="left">7</td>
<td align="center">2015-08-02</td>
<td align="center">N2</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -923,8 +923,8 @@ Longest: 1</p> @@ -923,8 +923,8 @@ Longest: 1</p>
<div class="sourceCode" id="cb23"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="no">genus</span>, <span class="no">species</span>)</pre></body></html></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,719<br>
Available: 15,719 (100%, NA: 0 = 0%)<br>
Length: 15,769<br>
Available: 15,769 (100%, NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -941,33 +941,33 @@ Longest: 24</p> @@ -941,33 +941,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,902</td>
<td align="right">50.27%</td>
<td align="right">7,902</td>
<td align="right">50.27%</td>
<td align="right">7,969</td>
<td align="right">50.54%</td>
<td align="right">7,969</td>
<td align="right">50.54%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,926</td>
<td align="right">24.98%</td>
<td align="right">11,828</td>
<td align="right">75.25%</td>
<td align="right">3,947</td>
<td align="right">25.03%</td>
<td align="right">11,916</td>
<td align="right">75.57%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,350</td>
<td align="right">14.95%</td>
<td align="right">14,178</td>
<td align="right">90.20%</td>
<td align="right">2,311</td>
<td align="right">14.66%</td>
<td align="right">14,227</td>
<td align="right">90.22%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,541</td>
<td align="right">9.80%</td>
<td align="right">15,719</td>
<td align="right">1,542</td>
<td align="right">9.78%</td>
<td align="right">15,769</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -994,50 +994,50 @@ Longest: 24</p> @@ -994,50 +994,50 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">AMX</td>
<td align="center">3775</td>
<td align="center">258</td>
<td align="center">3869</td>
<td align="center">7902</td>
<td align="center">3769</td>
<td align="center">276</td>
<td align="center">3924</td>
<td align="center">7969</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">AMC</td>
<td align="center">6238</td>
<td align="center">319</td>
<td align="center">1345</td>
<td align="center">7902</td>
<td align="center">6242</td>
<td align="center">307</td>
<td align="center">1420</td>
<td align="center">7969</td>
</tr>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">6031</td>
<td align="center">6044</td>
<td align="center">0</td>
<td align="center">1871</td>
<td align="center">7902</td>
<td align="center">1925</td>
<td align="center">7969</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">7105</td>
<td align="center">7149</td>
<td align="center">0</td>
<td align="center">797</td>
<td align="center">7902</td>
<td align="center">820</td>
<td align="center">7969</td>
</tr>
<tr class="odd">
<td align="center">K. pneumoniae</td>
<td align="center">AMX</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">1541</td>
<td align="center">1541</td>
<td align="center">1542</td>
<td align="center">1542</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">AMC</td>
<td align="center">1230</td>
<td align="center">43</td>
<td align="center">268</td>
<td align="center">1541</td>
<td align="center">1209</td>
<td align="center">69</td>
<td align="center">264</td>
<td align="center">1542</td>
</tr>
</tbody>
</table>
@ -1060,34 +1060,34 @@ Longest: 24</p> @@ -1060,34 +1060,34 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">6031</td>
<td align="center">6044</td>
<td align="center">0</td>
<td align="center">1871</td>
<td align="center">7902</td>
<td align="center">1925</td>
<td align="center">7969</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">CIP</td>
<td align="center">1174</td>
<td align="center">1182</td>
<td align="center">0</td>
<td align="center">367</td>
<td align="center">1541</td>
<td align="center">360</td>
<td align="center">1542</td>
</tr>
<tr class="odd">
<td align="center">S. aureus</td>
<td align="center">CIP</td>
<td align="center">2993</td>
<td align="center">3010</td>
<td align="center">0</td>
<td align="center">933</td>
<td align="center">3926</td>
<td align="center">937</td>
<td align="center">3947</td>
</tr>
<tr class="even">
<td align="center">S. pneumoniae</td>
<td align="center">CIP</td>
<td align="center">1807</td>
<td align="center">1777</td>
<td align="center">0</td>
<td align="center">543</td>
<td align="center">2350</td>
<td align="center">534</td>
<td align="center">2311</td>
</tr>
</tbody>
</table>
@ -1099,7 +1099,7 @@ Longest: 24</p> @@ -1099,7 +1099,7 @@ Longest: 24</p>
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb28"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span>(<span class="no">AMX</span>)
<span class="co"># [1] 0.5350213</span></pre></body></html></div>
<span class="co"># [1] 0.5378908</span></pre></body></html></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb29"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="no">hospital</span>) <span class="kw">%&gt;%</span>
@ -1113,19 +1113,19 @@ Longest: 24</p> @@ -1113,19 +1113,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5308117</td>
<td align="center">0.5322241</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5304522</td>
<td align="center">0.5324628</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.5364381</td>
<td align="center">0.5388535</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5479751</td>
<td align="center">0.5552030</td>
</tr>
</tbody>
</table>
@ -1144,23 +1144,23 @@ Longest: 24</p> @@ -1144,23 +1144,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.5308117</td>
<td align="center">4706</td>
<td align="center">0.5322241</td>
<td align="center">4748</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.5304522</td>
<td align="center">5484</td>
<td align="center">0.5324628</td>
<td align="center">5514</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.5364381</td>
<td align="center">2319</td>
<td align="center">0.5388535</td>
<td align="center">2355</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.5479751</td>
<td align="center">3210</td>
<td align="center">0.5552030</td>
<td align="center">3152</td>
</tr>
</tbody>
</table>
@ -1181,27 +1181,27 @@ Longest: 24</p> @@ -1181,27 +1181,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.8297899</td>
<td align="center">0.8991395</td>
<td align="center">0.9851936</td>
<td align="center">0.8218095</td>
<td align="center">0.8971013</td>
<td align="center">0.9858201</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.8260870</td>
<td align="center">0.8994160</td>
<td align="center">0.9883193</td>
<td align="center">0.8287938</td>
<td align="center">0.8949416</td>
<td align="center">0.9883268</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.8352012</td>
<td align="center">0.9238411</td>
<td align="center">0.9852267</td>
<td align="center">0.8198632</td>
<td align="center">0.9191791</td>
<td align="center">0.9863187</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.5425532</td>
<td align="center">0.5374297</td>
<td align="center">0.0000000</td>
<td align="center">0.5425532</td>
<td align="center">0.5374297</td>
</tr>
</tbody>
</table>

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

4
docs/articles/EUCAST.html

@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9037</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0</span>
</span>
</div>
@ -186,7 +186,7 @@ @@ -186,7 +186,7 @@
<h1 data-toc-skip>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">24 July 2020</h4>
<h4 class="date">30 July 2020</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/EUCAST.Rmd"><code>vignettes/EUCAST.Rmd</code></a></small>
<div class="hidden name"><code>EUCAST.Rmd</code></div>

66
docs/articles/MDR.html

@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9037</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0</span>
</span>
</div>
@ -186,7 +186,7 @@ @@ -186,7 +186,7 @@
<h1 data-toc-skip>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">24 July 2020</h4>
<h4 class="date">30 July 2020</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/MDR.Rmd"><code>vignettes/MDR.Rmd</code></a></small>
<div class="hidden name"><code>MDR.Rmd</code></div>
@ -306,19 +306,19 @@ Unique: 2</p> @@ -306,19 +306,19 @@ Unique: 2</p>
<p>The data set now looks like this:</p>
<div class="sourceCode" id="cb5"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(<span class="no">my_TB_data</span>)
<span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span>
<span class="co"># 1 R S S R R R</span>
<span class="co"># 2 R R R R I S</span>
<span class="co"># 3 S S S S R S</span>
<span class="co"># 4 S S R S S S</span>
<span class="co"># 5 R S R R I S</span>
<span class="co"># 6 R S R I S S</span>
<span class="co"># 1 S S R R S I</span>
<span class="co"># 2 R S R R R S</span>
<span class="co"># 3 R S S S I S</span>
<span class="co"># 4 S S I S R S</span>
<span class="co"># 5 R I R S R S</span>
<span class="co"># 6 S S S S R R</span>
<span class="co"># kanamycin</span>
<span class="co"># 1 R</span>
<span class="co"># 2 S</span>
<span class="co"># 3 R</span>
<span class="co"># 4 S</span>
<span class="co"># 1 I</span>
<span class="co"># 2 I</span>
<span class="co"># 3 S</span>