Browse Source

(v1.6.0.9011) unit tests

main
parent
commit
c5fff1c95c
  1. 4
      DESCRIPTION
  2. 4
      NEWS.md
  3. 1
      R/key_antimicrobials.R
  4. BIN
      R/sysdata.rda
  5. BIN
      data-raw/AMR_latest.tar.gz
  6. 38
      docs/404.html
  7. 38
      docs/LICENSE-text.html
  8. 822
      docs/articles/AMR.html
  9. 4
      docs/articles/AMR_files/anchor-sections-1.0/anchor-sections.css
  10. 33
      docs/articles/AMR_files/anchor-sections-1.0/anchor-sections.js
  11. BIN
      docs/articles/AMR_files/figure-html/disk_plots-1.png
  12. BIN
      docs/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png
  13. BIN
      docs/articles/AMR_files/figure-html/mic_plots-1.png
  14. BIN
      docs/articles/AMR_files/figure-html/mic_plots-2.png
  15. BIN
      docs/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png
  16. BIN
      docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png
  17. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  18. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  19. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  20. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  21. 67
      docs/articles/EUCAST.html
  22. 4
      docs/articles/EUCAST_files/anchor-sections-1.0/anchor-sections.css
  23. 33
      docs/articles/EUCAST_files/anchor-sections-1.0/anchor-sections.js
  24. 167
      docs/articles/MDR.html
  25. 4
      docs/articles/MDR_files/anchor-sections-1.0/anchor-sections.css
  26. 33
      docs/articles/MDR_files/anchor-sections-1.0/anchor-sections.js
  27. 107
      docs/articles/PCA.html
  28. BIN
      docs/articles/PCA_files/figure-html/unnamed-chunk-5-1.png
  29. BIN
      docs/articles/PCA_files/figure-html/unnamed-chunk-6-1.png
  30. BIN
      docs/articles/PCA_files/figure-html/unnamed-chunk-7-1.png
  31. 99
      docs/articles/SPSS.html
  32. 77
      docs/articles/WHONET.html
  33. BIN
      docs/articles/WHONET_files/figure-html/unnamed-chunk-7-1.png
  34. 151
      docs/articles/benchmarks.html
  35. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png
  36. 57
      docs/articles/datasets.html
  37. 4
      docs/articles/datasets_files/anchor-sections-1.0/anchor-sections.css
  38. 33
      docs/articles/datasets_files/anchor-sections-1.0/anchor-sections.js
  39. 38
      docs/articles/index.html
  40. 111
      docs/articles/resistance_predict.html
  41. BIN
      docs/articles/resistance_predict_files/figure-html/unnamed-chunk-4-1.png
  42. BIN
      docs/articles/resistance_predict_files/figure-html/unnamed-chunk-5-1.png
  43. BIN
      docs/articles/resistance_predict_files/figure-html/unnamed-chunk-5-2.png
  44. BIN
      docs/articles/resistance_predict_files/figure-html/unnamed-chunk-6-1.png
  45. BIN
      docs/articles/resistance_predict_files/figure-html/unnamed-chunk-7-1.png
  46. 41
      docs/articles/welcome_to_AMR.html
  47. 38
      docs/authors.html
  48. 62
      docs/index.html
  49. 752
      docs/news/index.html
  50. 4
      docs/pkgdown.yml
  51. 38
      docs/reference/AMR.html
  52. 38
      docs/reference/WHOCC.html
  53. 38
      docs/reference/WHONET.html
  54. 38
      docs/reference/ab_property.html
  55. 38
      docs/reference/age.html
  56. 38
      docs/reference/age_groups.html
  57. 38
      docs/reference/antibiotic_class_selectors.html
  58. 38
      docs/reference/antibiotics.html
  59. 38
      docs/reference/as.disk.html
  60. 38
      docs/reference/as.mic.html
  61. 38
      docs/reference/as.rsi.html
  62. 38
      docs/reference/atc_online.html
  63. 38
      docs/reference/availability.html
  64. 38
      docs/reference/bug_drug_combinations.html
  65. 38
      docs/reference/catalogue_of_life.html
  66. 38
      docs/reference/catalogue_of_life_version.html
  67. 38
      docs/reference/count.html
  68. 38
      docs/reference/dosage.html
  69. 38
      docs/reference/eucast_rules.html
  70. 38
      docs/reference/example_isolates.html
  71. 38
      docs/reference/example_isolates_unclean.html
  72. 38
      docs/reference/filter_ab_class.html
  73. 38
      docs/reference/g.test.html
  74. 38
      docs/reference/get_episode.html
  75. 40
      docs/reference/ggplot_pca.html
  76. 40
      docs/reference/ggplot_rsi.html
  77. 38
      docs/reference/guess_ab_col.html
  78. 42
      docs/reference/index.html
  79. 38
      docs/reference/intrinsic_resistant.html
  80. 38
      docs/reference/join.html
  81. 42
      docs/reference/key_antimicrobials.html
  82. 38
      docs/reference/kurtosis.html
  83. 38
      docs/reference/lifecycle.html
  84. 38
      docs/reference/microorganisms.codes.html
  85. 38
      docs/reference/microorganisms.old.html
  86. 38
      docs/reference/mo_matching_score.html
  87. 38
      docs/reference/mo_property.html
  88. 38
      docs/reference/mo_source.html
  89. 38
      docs/reference/pca.html
  90. 46
      docs/reference/plot.html
  91. 38
      docs/reference/proportion.html
  92. 38
      docs/reference/random.html
  93. 42
      docs/reference/resistance_predict.html
  94. 38
      docs/reference/rsi_translation.html
  95. 38
      docs/reference/skewness.html
  96. 38
      docs/reference/translate.html
  97. 38
      docs/survey.html
  98. 2
      man/key_antimicrobials.Rd
  99. 2
      tests/testthat/test-key_antimicrobials.R

4
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 1.6.0.9010
Date: 2021-04-26
Version: 1.6.0.9011
Date: 2021-04-27
Title: Antimicrobial Resistance Data Analysis
Authors@R: c(
person(role = c("aut", "cre"),

4
NEWS.md

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
# AMR 1.6.0.9010
## <small>Last updated: 26 April 2021</small>
# AMR 1.6.0.9011
## <small>Last updated: 27 April 2021</small>
### New
* Function `custom_eucast_rules()` that brings support for custom AMR rules in `eucast_rules()`

1
R/key_antimicrobials.R

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
#' @param gram_negative names of antibiotic agents for **Gram-positives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param gram_positive names of antibiotic agents for **Gram-negatives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param antifungal names of antifungal agents for **fungi**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param only_rsi_columns a logical to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @param ... ignored, allows for future extensions
#' @details
#' The [key_antimicrobials()] and [all_antimicrobials()] functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*.

BIN
R/sysdata.rda

Binary file not shown.

BIN
data-raw/AMR_latest.tar.gz

Binary file not shown.

38
docs/404.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="news/index.html">
<span class="far fa-newspaper"></span>
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa-github"></span>
<span class="fab fa fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

38
docs/LICENSE-text.html

@ -81,7 +81,7 @@ @@ -81,7 +81,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.6.0.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="news/index.html">
<span class="far fa-newspaper"></span>
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa-github"></span>
<span class="fab fa fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

822
docs/articles/AMR.html

File diff suppressed because it is too large Load Diff

4
docs/articles/AMR_files/anchor-sections-1.0/anchor-sections.css

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
/* Styles for section anchors */
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
a.anchor-section::before {content: '#';}
.hasAnchor:hover a.anchor-section {visibility: visible;}

33
docs/articles/AMR_files/anchor-sections-1.0/anchor-sections.js

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020.
document.addEventListener('DOMContentLoaded', function() {
// Do nothing if AnchorJS is used
if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) {
return;
}
const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
// Do nothing if sections are already anchored
if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) {
return null;
}
// Use section id when pandoc runs with --section-divs
const section_id = function(x) {
return ((x.classList.contains('section') || (x.tagName === 'SECTION'))
? x.id : '');
};
// Add anchors
h.forEach(function(x) {
const id = x.id || section_id(x.parentElement);
if (id === '') {
return null;
}
let anchor = document.createElement('a');
anchor.href = '#' + id;
anchor.classList = ['anchor-section'];
x.classList.add('hasAnchor');
x.appendChild(anchor);
});
});

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 39 KiB

BIN
docs/articles/AMR_files/figure-html/disk_plots_mo_ab-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/mic_plots-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/articles/AMR_files/figure-html/mic_plots-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 39 KiB

BIN
docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 50 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 71 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

67
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.5.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span>
</span>
</div>
@ -47,14 +47,14 @@ @@ -47,14 +47,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -63,77 +63,77 @@ @@ -63,77 +63,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -142,21 +142,21 @@ @@ -142,21 +142,21 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/index.html">
<span class="far fa-newspaper"></span>
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
@ -165,14 +165,14 @@ @@ -165,14 +165,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa-github"></span>
<span class="fab fa fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -187,7 +187,8 @@ @@ -187,7 +187,8 @@
</header><script src="EUCAST_files/header-attrs-2.6/header-attrs.js"></script><div class="row">
</header><link href="EUCAST_files/anchor-sections-1.0/anchor-sections.css" rel="stylesheet">
<script src="EUCAST_files/anchor-sections-1.0/anchor-sections.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>How to apply EUCAST rules</h1>
@ -215,8 +216,8 @@ @@ -215,8 +216,8 @@
<a href="#examples" class="anchor"></a>Examples</h2>
<p>These rules can be used to discard impossible bug-drug combinations in your data. For example, <em>Klebsiella</em> produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, practically every strain of <em>Klebsiella</em> is resistant to ampicillin.</p>
<p>Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, <em>Klebsiella</em>). EUCAST expert rules solve this, that can be applied using <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">oops</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Klebsiella"</span>,
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="va">oops</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Klebsiella"</span>,
<span class="st">"Escherichia"</span><span class="op">)</span>,
ampicillin <span class="op">=</span> <span class="st">"S"</span><span class="op">)</span>
<span class="va">oops</span>
@ -227,19 +228,19 @@ @@ -227,19 +228,19 @@
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">oops</span>, info <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>
<span class="co"># mo ampicillin</span>
<span class="co"># 1 Klebsiella R</span>
<span class="co"># 2 Escherichia S</span></code></pre></div>
<span class="co"># 2 Escherichia S</span></pre></div>
<p>A more convenient function is <code><a href="../reference/mo_property.html">mo_is_intrinsic_resistant()</a></code> that uses the same guideline, but allows to check for one or more specific microorganisms or antibiotics:</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="../reference/mo_property.html">mo_is_intrinsic_resistant</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Klebsiella"</span>, <span class="st">"Escherichia"</span><span class="op">)</span>,
<div class="sourceCode" id="cb2"><pre class="downlit">
<span class="fu"><a href="../reference/mo_property.html">mo_is_intrinsic_resistant</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Klebsiella"</span>, <span class="st">"Escherichia"</span><span class="op">)</span>,
<span class="st">"ampicillin"</span><span class="op">)</span>
<span class="co"># [1] TRUE FALSE</span>
<span class="fu"><a href="../reference/mo_property.html">mo_is_intrinsic_resistant</a></span><span class="op">(</span><span class="st">"Klebsiella"</span>,
<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"ampicillin"</span>, <span class="st">"kanamycin"</span><span class="op">)</span><span class="op">)</span>
<span class="co"># [1] TRUE FALSE</span></code></pre></div>
<span class="co"># [1] TRUE FALSE</span></pre></div>
<p>EUCAST rules can not only be used for correction, they can also be used for filling in known resistance and susceptibility based on results of other antimicrobials drugs. This process is called <em>interpretive reading</em>, is basically a form of imputation, and is part of the <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> function as well:</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span>,
<div class="sourceCode" id="cb3"><pre class="downlit">
<span class="va">data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span>,
<span class="st">"Enterococcus faecalis"</span>,
<span class="st">"Escherichia coli"</span>,
<span class="st">"Klebsiella pneumoniae"</span>,
@ -251,9 +252,9 @@ @@ -251,9 +252,9 @@
CXM <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Cefuroxime</span>
PEN <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Benzylenicillin</span>
FOX <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Cefoxitin</span>
stringsAsFactors <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data</span></code></pre></div>
stringsAsFactors <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div>
<div class="sourceCode" id="cb4"><pre class="downlit">
<span class="va">data</span></pre></div>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>
@ -318,8 +319,8 @@ @@ -318,8 +319,8 @@
</tr>
</tbody>
</table>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">data</span><span class="op">)</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="downlit">
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">data</span><span class="op">)</span></pre></div>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>

4
docs/articles/EUCAST_files/anchor-sections-1.0/anchor-sections.css

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
/* Styles for section anchors */
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
a.anchor-section::before {content: '#';}
.hasAnchor:hover a.anchor-section {visibility: visible;}

33
docs/articles/EUCAST_files/anchor-sections-1.0/anchor-sections.js

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020.
document.addEventListener('DOMContentLoaded', function() {
// Do nothing if AnchorJS is used
if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) {
return;
}
const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
// Do nothing if sections are already anchored
if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) {
return null;
}
// Use section id when pandoc runs with --section-divs
const section_id = function(x) {
return ((x.classList.contains('section') || (x.tagName === 'SECTION'))
? x.id : '');
};
// Add anchors
h.forEach(function(x) {
const id = x.id || section_id(x.parentElement);
if (id === '') {
return null;
}
let anchor = document.createElement('a');
anchor.href = '#' + id;
anchor.classList = ['anchor-section'];
x.classList.add('hasAnchor');
x.appendChild(anchor);
});
});

167
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.5.0.9018</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span>
</span>
</div>
@ -47,14 +47,14 @@ @@ -47,14 +47,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -63,77 +63,77 @@ @@ -63,77 +63,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -142,21 +142,21 @@ @@ -142,21 +142,21 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/index.html">
<span class="far fa-newspaper"></span>
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
@ -165,14 +165,14 @@ @@ -165,14 +165,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa-github"></span>
<span class="fab fa fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -187,7 +187,8 @@ @@ -187,7 +187,8 @@
</header><script src="MDR_files/header-attrs-2.6/header-attrs.js"></script><div class="row">
</header><link href="MDR_files/anchor-sections-1.0/anchor-sections.css" rel="stylesheet">
<script src="MDR_files/anchor-sections-1.0/anchor-sections.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>How to determine multi-drug resistance (MDR)</h1>
@ -243,27 +244,27 @@ @@ -243,27 +244,27 @@
<a href="#custom-guidelines" class="anchor"></a>Custom Guidelines</h4>
<p>You can also use your own custom guideline. Custom guidelines can be set with the <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.</p>
<p>If you are familiar with <code><a href="https://dplyr.tidyverse.org/reference/case_when.html">case_when()</a></code> of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what considers to be the ‘formula notation’:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">custom</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">custom_mdro_guideline</a></span><span class="op">(</span><span class="va">CIP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type A"</span>,
<span class="va">ERY</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type B"</span><span class="op">)</span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="va">custom</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">custom_mdro_guideline</a></span><span class="op">(</span><span class="va">CIP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type A"</span>,
<span class="va">ERY</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type B"</span><span class="op">)</span></pre></div>
<p>If a row/an isolate matches the first rule, the value after the first <code><a href="https://rdrr.io/r/base/tilde.html">~</a></code> (in this case <em>‘Elderly Type A’</em>) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.</p>
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">custom</span>
<div class="sourceCode" id="cb2"><pre class="downlit">
<span class="va">custom</span>
<span class="co"># A set of custom MDRO rules:</span>
<span class="co"># 1. CIP is "R" and age is higher than 60 -&gt; Elderly Type A</span>
<span class="co"># 2. ERY is "R" and age is higher than 60 -&gt; Elderly Type B</span>
<span class="co"># 3. Otherwise -&gt; Negative</span>
<span class="co"># 1. If CIP is "R" and age is higher than 60 then: Elderly Type A</span>
<span class="co"># 2. If ERY is "R" and age is higher than 60 then: Elderly Type B</span>
<span class="co"># 3. Otherwise: Negative</span>
<span class="co"># </span>
<span class="co"># Unmatched rows will return NA.</span>
<span class="co"># Results will be of class &lt;factor&gt;, with ordered levels: Negative &lt; Elderly Type A &lt; Elderly Type B</span></code></pre></div>
<span class="co"># Results will be of class &lt;factor&gt;, with ordered levels: Negative &lt; Elderly Type A &lt; Elderly Type B</span></pre></div>
<p>The outcome of the function can be used for the <code>guideline</code> argument in the [mdro()] function:</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">x</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">example_isolates</span>, guideline <span class="op">=</span> <span class="va">custom</span><span class="op">)</span>
<div class="sourceCode" id="cb3"><pre class="downlit">
<span class="va">x</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">example_isolates</span>, guideline <span class="op">=</span> <span class="va">custom</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/table.html">table</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># x</span>
<span class="co"># Negative Elderly Type A Elderly Type B </span>
<span class="co"># 1066 43 891</span></code></pre></div>
<span class="co"># 1070 198 732</span></pre></div>
<p>The rules set (the <code>custom</code> object in this case) could be exported to a shared file location using <code><a href="https://rdrr.io/r/base/readRDS.html">saveRDS()</a></code> if you collaborate with multiple users. The custom rules set could then be imported using <code><a href="https://rdrr.io/r/base/readRDS.html">readRDS()</a></code>.</p>
</div>
</div>
@ -272,15 +273,15 @@ @@ -272,15 +273,15 @@
<a href="#examples" class="anchor"></a>Examples</h3>
<p>The <code><a href="../reference/mdro.html">mdro()</a></code> function always returns an ordered <code>factor</code>. For example, the output of the default guideline by Magiorakos <em>et al.</em> returns a <code>factor</code> with levels ‘Negative’, ‘MDR’, ‘XDR’ or ‘PDR’ in that order.</p>
<p>The next example uses the <code>example_isolates</code> data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR data analysis. If we test the MDR/XDR/PDR guideline on this data set, we get:</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span> <span class="co"># to support pipes: %&gt;%</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/msberends/cleaner">cleaner</a></span><span class="op">)</span> <span class="co"># to create frequency tables</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">example_isolates</span> <span class="op">%&gt;%</span>
<div class="sourceCode" id="cb4"><pre class="downlit">
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span> <span class="co"># to support pipes: %&gt;%</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/msberends/cleaner">cleaner</a></span><span class="op">)</span> <span class="co"># to create frequency tables</span></pre></div>
<div class="sourceCode" id="cb5"><pre class="downlit">
<span class="va">example_isolates</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="op">)</span> <span class="co"># show frequency table of the result</span>
<span class="co"># Warning: NA introduced for isolates where the available percentage of antimicrobial</span>
<span class="co"># classes was below 50% (set with `pct_required_classes`)</span></code></pre></div>
<span class="co"># classes was below 50% (set with `pct_required_classes`)</span></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: factor &gt; ordered (numeric)<br>
Length: 2,000<br>
@ -316,8 +317,8 @@ Unique: 2</p> @@ -316,8 +317,8 @@ Unique: 2</p>
</tbody>
</table>
<p>For another example, I will create a data set to determine multi-drug resistant TB:</p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># random_rsi() is a helper function to generate</span>
<div class="sourceCode" id="cb6"><pre class="downlit">
<span class="co"># random_rsi() is a helper function to generate</span>
<span class="co"># a random vector with values S, I and R</span>
<span class="va">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>rifampicin <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
isoniazid <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
@ -325,44 +326,44 @@ Unique: 2</p> @@ -325,44 +326,44 @@ Unique: 2</p>
ethambutol <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
pyrazinamide <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
moxifloxacin <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
kanamycin <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span><span class="op">)</span></code></pre></div>
kanamycin <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span><span class="op">)</span></pre></div>
<p>Because all column names are automatically verified for valid drug names or codes, this would have worked exactly the same:</p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>RIF <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
<div class="sourceCode" id="cb7"><pre class="downlit">
<span class="va">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>RIF <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
INH <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
GAT <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
ETH <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
PZA <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
MFX <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span>,
KAN <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span><span class="op">)</span></code></pre></div>
KAN <span class="op">=</span> <span class="fu"><a href="../reference/random.html">random_rsi</a></span><span class="op">(</span><span class="fl">5000</span><span class="op">)</span><span class="op">)</span></pre></div>
<p>The data set now looks like this:</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span>
<div class="sourceCode" id="cb8"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span>
<span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span>
<span class="co"># 1 S R S S S I</span>
<span class="co"># 2 S I R R R R</span>
<span class="co"># 3 R S S I S I</span>
<span class="co"># 4 I S S S I S</span>
<span class="co"># 5 I I I S I R</span>
<span class="co"># 6 S I S R S S</span>
<span class="co"># 1 S S S S R R</span>
<span class="co"># 2 R S S S I R</span>
<span class="co"># 3 R R I R I R</span>
<span class="co"># 4 R R S S R I</span>
<span class="co"># 5 R R R I I I</span>
<span class="co"># 6 R I R R I I</span>
<span class="co"># kanamycin</span>
<span class="co"># 1 R</span>
<span class="co"># 2 I</span>
<span class="co"># 3 R</span>
<span class="co"># 4 S</span>
<span class="co"># 1 I</span>
<span class="co"># 2 R</span>
<span class="co"># 3 I</span>
<span class="co"># 4 I</span>
<span class="co"># 5 S</span>
<span class="co"># 6 R</span></code></pre></div>
<span class="co"># 6 I</span></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">my_TB_data</span>, guideline <span class="op">=</span> <span class="st">"TB"</span><span class="op">)</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="downlit">
<span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">my_TB_data</span>, guideline <span class="op">=</span> <span class="st">"TB"</span><span class="op">)</span></pre></div>