Browse Source

(v0.7.1.9030) eucast_rules() fix

new-mo-algorithm
parent
commit
22a206ffd8
  1. 26
      DESCRIPTION
  2. 6
      NEWS.md
  3. 17
      R/eucast_rules.R
  4. BIN
      R/sysdata.rda
  5. 2
      data-raw/eucast_rules.tsv
  6. 2
      docs/LICENSE-text.html
  7. 414
      docs/articles/AMR.html
  8. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  9. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  10. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  11. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  12. 4
      docs/articles/EUCAST.html
  13. 44
      docs/articles/MDR.html
  14. 24
      docs/articles/SPSS.html
  15. 4
      docs/articles/WHONET.html
  16. 76
      docs/articles/benchmarks.html
  17. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png
  18. 2
      docs/articles/index.html
  19. 22
      docs/articles/resistance_predict.html
  20. 18
      docs/authors.html
  21. 2
      docs/extra.js
  22. 2
      docs/index.html
  23. 44
      docs/news/index.html
  24. 2
      docs/reference/AMR-deprecated.html
  25. 2
      docs/reference/AMR.html
  26. 2
      docs/reference/WHOCC.html
  27. 2
      docs/reference/WHONET.html
  28. 2
      docs/reference/ab_property.html
  29. 2
      docs/reference/age.html
  30. 2
      docs/reference/age_groups.html
  31. 2
      docs/reference/antibiotics.html
  32. 2
      docs/reference/as.ab.html
  33. 2
      docs/reference/as.disk.html
  34. 2
      docs/reference/as.mic.html
  35. 2
      docs/reference/as.mo.html
  36. 2
      docs/reference/as.rsi.html
  37. 2
      docs/reference/atc_online.html
  38. 2
      docs/reference/availability.html
  39. 2
      docs/reference/catalogue_of_life.html
  40. 2
      docs/reference/catalogue_of_life_version.html
  41. 2
      docs/reference/count.html
  42. 2
      docs/reference/eucast_rules.html
  43. 2
      docs/reference/extended-functions.html
  44. 2
      docs/reference/filter_ab_class.html
  45. 2
      docs/reference/first_isolate.html
  46. 2
      docs/reference/g.test.html
  47. 2
      docs/reference/ggplot_rsi.html
  48. 2
      docs/reference/guess_ab_col.html
  49. 2
      docs/reference/index.html
  50. 2
      docs/reference/join.html
  51. 2
      docs/reference/key_antibiotics.html
  52. 2
      docs/reference/kurtosis.html
  53. 2
      docs/reference/like.html
  54. 2
      docs/reference/mdro.html
  55. 2
      docs/reference/microorganisms.codes.html
  56. 2
      docs/reference/microorganisms.html
  57. 2
      docs/reference/microorganisms.old.html
  58. 2
      docs/reference/mo_property.html
  59. 2
      docs/reference/mo_source.html
  60. 2
      docs/reference/p.symbol.html
  61. 2
      docs/reference/portion.html
  62. 2
      docs/reference/read.4D.html
  63. 2
      docs/reference/resistance_predict.html
  64. 2
      docs/reference/rsi_translation.html
  65. 2
      docs/reference/septic_patients.html
  66. 2
      docs/reference/skewness.html
  67. 2
      docs/reference/translate.html
  68. 2
      pkgdown/extra.js
  69. 25
      vignettes/SPSS.Rmd
  70. 14
      vignettes/resistance_predict.Rmd

26
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 0.7.1.9029
Date: 2019-08-07
Version: 0.7.1.9030
Date: 2019-08-08
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@ -15,11 +15,6 @@ Authors@R: c( @@ -15,11 +15,6 @@ Authors@R: c(
email = "c.f.luz@umcg.nl",
role = "aut",
comment = c(ORCID = "0000-0001-5809-5995")),
person(
given = c("Erwin", "E.", "A."),
family = "Hassing",
email = "e.hassing@certe.nl",
role = "ctb"),
person(
given = "Corinna",
family = "Glasner",
@ -37,7 +32,22 @@ Authors@R: c( @@ -37,7 +32,22 @@ Authors@R: c(
family = "Sinha",
email = "b.sinha@umcg.nl",
role = c("aut", "ths"),
comment = c(ORCID = "0000-0003-1634-0010")))
comment = c(ORCID = "0000-0003-1634-0010")),
person(
given = c("Erwin", "E.", "A."),
family = "Hassing",
email = "e.hassing@certe.nl",
role = "ctb"),
person(
given = c("Bart", "C."),
family = "Meijer",
email = "b.meijerg@certe.nl",
role = "ctb"),
person(
given = "Dennis",
family = "Souverein",
email = "d.souvereing@streeklabhaarlem.nl",
role = "ctb"))
Description: Functions to simplify the analysis and prediction of Antimicrobial
Resistance (AMR) and to work with microbial and antimicrobial properties by
using evidence-based methods.

6
NEWS.md

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# AMR 0.7.1.9029
# AMR 0.7.1.9030
### Breaking
* Function `freq()` has moved to a new package, [`clean`](https://github.com/msberends/clean) ([CRAN link](https://cran.r-project.org/package=clean)). Creating frequency tables is actually not the scope of this package (never was) and this function has matured a lot over the last two years. Therefore, a new package was created for data cleaning and checking and it perfectly fits the `freq()` function. The [`clean`](https://github.com/msberends/clean) package is available on CRAN and will be installed automatically when updating the `AMR` package, that now imports it. In a later stage, the `skewness()` and `kurtosis()` functions will be moved to the `clean` package too.
@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
### Changed
* Added more informative errors and warnings to `eucast_rules()`
* Fixed a bug in `eucast_rules()` where antibiotic columns would be read as lists instead of characters
* Added tibble printing support for classes `rsi`, `mic`, `ab` and `mo`. When using tibbles containing antibiotic columns, values `S` will print in green, values `I` will print in yellow and values `R` will print in red:
```r
(run this on your own console, as this page does not support colour printing)
@ -63,6 +64,9 @@ @@ -63,6 +64,9 @@
* Speed improvement for `guess_ab_col()` which is now 30 times faster for antibiotic abbreviations
* Using factors as input for `eucast_rules()` now adds missing factors levels when the function changes antibiotic results
#### Other
* Added Dr Bart Meijer and Dr Dennis Souverein as contributors
# AMR 0.7.1
#### New

17
R/eucast_rules.R

@ -416,10 +416,12 @@ eucast_rules <- function(x, @@ -416,10 +416,12 @@ eucast_rules <- function(x,
},
error = function(e) {
txt_error()
stop(paste0("Error in row(s) ", paste(rows[1:min(length(rows), 10)], collapse = ","),
'... while writing value "', to,
stop(paste0("In row(s) ", paste(rows[1:min(length(rows), 10)], collapse = ","),
ifelse(length(rows) > 10, "...", ""),
' while writing value "', to,
'" to column(s) `', paste(cols, collapse = "`, `"),
"` (data class:", paste(class(x_original), collapse = "/"), "):\n", e$message), call. = FALSE)
"` (data class: ", paste(class(x_original), collapse = "/"), "):\n", e$message),
call. = FALSE)
}
)
@ -520,6 +522,9 @@ eucast_rules <- function(x, @@ -520,6 +522,9 @@ eucast_rules <- function(x,
x <- trimws(unlist(strsplit(x, ",", fixed = TRUE)))
y <- character(0)
for (i in 1:length(x)) {
if (is.function(get(x[i]))) {
stop("Column ", x[i], " is also a function. Please create an issue on github.com/msberends/AMR/issues.")
}
y <- c(y, tryCatch(get(x[i]), error = function(e) ""))
}
y[y != "" & y %in% colnames(df)]
@ -736,7 +741,7 @@ eucast_rules <- function(x, @@ -736,7 +741,7 @@ eucast_rules <- function(x,
mutate(plural = ifelse(n > 1, "s", ""),
txt = paste0(formatnr(n), " test result", plural, " added as ", new)) %>%
pull(txt) %>%
paste(" *", ., collapse = "\n") %>%
paste(" -", ., collapse = "\n") %>%
cat()
}
@ -765,7 +770,7 @@ eucast_rules <- function(x, @@ -765,7 +770,7 @@ eucast_rules <- function(x,
mutate(plural = ifelse(n > 1, "s", ""),
txt = paste0(formatnr(n), " test result", plural, " changed from ", old, " to ", new)) %>%
pull(txt) %>%
paste(" *", ., collapse = "\n") %>%
paste(" -", ., collapse = "\n") %>%
cat()
cat("\n")
}
@ -774,7 +779,7 @@ eucast_rules <- function(x, @@ -774,7 +779,7 @@ eucast_rules <- function(x,
if (verbose == FALSE & nrow(verbose_info) > 0) {
cat(paste("\nUse", bold("eucast_rules(..., verbose = TRUE)"), "(on your original data) to get a data.frame with all specified edits instead.\n\n"))
} else if (verbose == TRUE) {
cat(paste(red("\nUsed 'Verbose mode' (verbose = TRUE)"), ", which returns a data.frame with all specified edits.\nUse", bold("verbose = FALSE"), "to apply the rules on your data.\n\n"))
cat(paste0("\nUsed 'Verbose mode' (", bold("verbose = TRUE"), "), which returns a data.frame with all specified edits.\nUse ", bold("verbose = FALSE"), " to apply the rules on your data.\n\n"))
}
}

BIN
R/sysdata.rda

Binary file not shown.

2
data-raw/eucast_rules.tsv

@ -126,7 +126,7 @@ genus_species is Providencia stuartii aminopenicillins, AMC, CZO, CXM, tetracy @@ -126,7 +126,7 @@ genus_species is Providencia stuartii aminopenicillins, AMC, CZO, CXM, tetracy
genus is Raoultella aminopenicillins, TIC R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
genus_species is Serratia marcescens aminopenicillins, AMC, CZO, FOX, CXM, DOX, TCY, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
genus_species is Yersinia enterocolitica aminopenicillins, AMC, TIC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
genus_species is Yersinia pseudotuberculosis poly, COL R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
genus_species is Yersinia pseudotuberculosis PLB, COL R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
genus one_of Achromobacter, Acinetobacter, Alcaligenes, Bordatella, Burkholderia, Elizabethkingia, Flavobacterium, Ochrobactrum, Pseudomonas, Stenotrophomonas PEN, FOX, CXM, glycopeptides, FUS, macrolides, LIN, streptogramins, RIF, DAP, LNZ R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
genus_species is Acinetobacter baumannii aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
genus_species is Acinetobacter pittii aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules

Can't render this file because it contains an unexpected character in line 6 and column 94.

2
docs/LICENSE-text.html

@ -78,7 +78,7 @@ @@ -78,7 +78,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">0.7.1.9029</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9030</span>
</span>
</div>

414
docs/articles/AMR.html

@ -40,7 +40,7 @@ @@ -40,7 +40,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">0.7.1.9027</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9029</span>
</span>
</div>
@ -185,7 +185,7 @@ @@ -185,7 +185,7 @@
<h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">07 August 2019</h4>
<h4 class="date">08 August 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -194,7 +194,7 @@ @@ -194,7 +194,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 07 August 2019.</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 08 August 2019.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -210,21 +210,21 @@ @@ -210,21 +210,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2019-08-07</td>
<td align="center">2019-08-08</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">2019-08-07</td>
<td align="center">2019-08-08</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">2019-08-07</td>
<td align="center">2019-08-08</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -320,10 +320,10 @@ @@ -320,10 +320,10 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2017-01-02</td>
<td align="center">V8</td>
<td align="center">Hospital A</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">2017-01-03</td>
<td align="center">T3</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
@ -331,58 +331,58 @@ @@ -331,58 +331,58 @@
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2013-05-08</td>
<td align="center">W2</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">2012-11-05</td>
<td align="center">F9</td>
<td align="center">Hospital D</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">S</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">2015-08-15</td>
<td align="center">R1</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">2011-12-06</td>
<td align="center">I5</td>
<td align="center">Hospital C</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2012-01-09</td>
<td align="center">X9</td>
<td align="center">2011-03-10</td>
<td align="center">B9</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2014-06-18</td>
<td align="center">Z7</td>
<td align="center">2010-06-27</td>
<td align="center">A2</td>
<td align="center">Hospital D</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">Escherichia 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>
</tr>
<tr class="even">
<td align="center">2015-02-18</td>
<td align="center">F4</td>
<td align="center">2017-12-11</td>
<td align="center">F8</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
</tr>
</tbody>
@ -406,8 +406,8 @@ @@ -406,8 +406,8 @@
#
# Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- -------------
# 1 M 10,401 52.0% 10,401 52.0%
# 2 F 9,599 48.0% 20,000 100.0%</code></pre>
# 1 M 10,468 52.3% 10,468 52.3%
# 2 F 9,532 47.7% 20,000 100.0%</code></pre>
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -437,14 +437,14 @@ @@ -437,14 +437,14 @@
<a class="sourceLine" id="cb15-18" data-line-number="18"><span class="co"># Pasteurella multocida (no values changed)</span></a>
<a class="sourceLine" id="cb15-19" data-line-number="19"><span class="co"># Staphylococcus (no values changed)</span></a>
<a class="sourceLine" id="cb15-20" data-line-number="20"><span class="co"># Streptococcus groups A, B, C, G (no values changed)</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,456 values changed)</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,480 values changed)</span></a>
<a class="sourceLine" id="cb15-22" data-line-number="22"><span class="co"># Viridans group streptococci (no values changed)</span></a>
<a class="sourceLine" id="cb15-23" data-line-number="23"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-24" data-line-number="24"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,287 values changed)</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,293 values changed)</span></a>
<a class="sourceLine" id="cb15-26" data-line-number="26"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no values changed)</span></a>
<a class="sourceLine" id="cb15-27" data-line-number="27"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no values changed)</span></a>
<a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,759 values changed)</span></a>
<a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,772 values changed)</span></a>
<a class="sourceLine" id="cb15-29" data-line-number="29"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no values changed)</span></a>
<a class="sourceLine" id="cb15-30" data-line-number="30"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no values changed)</span></a>
<a class="sourceLine" id="cb15-31" data-line-number="31"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no values changed)</span></a>
@ -452,24 +452,24 @@ @@ -452,24 +452,24 @@
<a class="sourceLine" id="cb15-33" data-line-number="33"><span class="co"># Table 13: Interpretive rules for quinolones (no values changed)</span></a>
<a class="sourceLine" id="cb15-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-35" data-line-number="35"><span class="co"># Other rules</span></a>
<a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,330 values changed)</span></a>
<a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (108 values changed)</span></a>
<a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,251 values changed)</span></a>
<a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (117 values changed)</span></a>
<a class="sourceLine" id="cb15-38" data-line-number="38"><span class="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no values changed)</span></a>
<a class="sourceLine" id="cb15-39" data-line-number="39"><span class="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no values changed)</span></a>
<a class="sourceLine" id="cb15-40" data-line-number="40"><span class="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no values changed)</span></a>
<a class="sourceLine" id="cb15-41" data-line-number="41"><span class="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no values changed)</span></a>
<a class="sourceLine" id="cb15-42" data-line-number="42"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-43" data-line-number="43"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,604 out of 20,000 rows, making a total of 7,940 edits</span></a>
<a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,550 out of 20,000 rows, making a total of 7,913 edits</span></a>
<a class="sourceLine" id="cb15-45" data-line-number="45"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb15-46" data-line-number="46"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,940 test results</span></a>
<a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># * 110 test results changed from S to I</span></a>
<a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># * 4,715 test results changed from S to R</span></a>
<a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># * 1,119 test results changed from I to S</span></a>
<a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># * 307 test results changed from I to R</span></a>
<a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># * 1,664 test results changed from R to S</span></a>
<a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># * 25 test results changed from R to I</span></a>
<a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,913 test results</span></a>
<a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># * 111 test results changed from S to I</span></a>
<a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># * 4,763 test results changed from S to R</span></a>
<a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># * 1,086 test results changed from I to S</span></a>
<a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># * 349 test results changed from I to R</span></a>
<a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># * 1,585 test results changed from R to S</span></a>
<a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># * 19 test results changed from R to I</span></a>
<a class="sourceLine" id="cb15-54" data-line-number="54"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-55" data-line-number="55"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-56" data-line-number="56"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -497,7 +497,7 @@ @@ -497,7 +497,7 @@
<a class="sourceLine" id="cb17-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb17-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb17-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,676 first isolates (28.4% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,610 first isolates (28.0% of total)</span></a></code></pre></div>
<p>So only 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="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
@ -508,7 +508,7 @@ @@ -508,7 +508,7 @@
<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 M4, 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 W2, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -524,10 +524,10 @@ @@ -524,10 +524,10 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-02</td>
<td align="center">M4</td>
<td align="center">2010-02-15</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
@ -535,8 +535,8 @@ @@ -535,8 +535,8 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-05-26</td>
<td align="center">M4</td>
<td align="center">2010-05-10</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -546,10 +546,10 @@ @@ -546,10 +546,10 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-07-15</td>
<td align="center">M4</td>
<td align="center">2010-08-30</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
@ -557,8 +557,8 @@ @@ -557,8 +557,8 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-09-11</td>
<td align="center">M4</td>
<td align="center">2010-09-27</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -568,32 +568,32 @@ @@ -568,32 +568,32 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-11-13</td>
<td align="center">M4</td>
<td align="center">2010-10-28</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-11-16</td>
<td align="center">M4</td>
<td align="center">2010-12-01</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-01-03</td>
<td align="center">M4</td>
<td align="center">2011-01-20</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
@ -601,30 +601,30 @@ @@ -601,30 +601,30 @@
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-03-16</td>
<td align="center">M4</td>
<td align="center">2011-02-09</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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="odd">
<td align="center">9</td>
<td align="center">2011-04-21</td>
<td align="center">M4</td>
<td align="center">2011-03-08</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">R</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-24</td>
<td align="center">M4</td>
<td align="center">2011-04-14</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -645,7 +645,7 @@ @@ -645,7 +645,7 @@
<a class="sourceLine" id="cb20-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb20-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb20-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 14,973 first weighted isolates (74.9% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 15,032 first weighted isolates (75.2% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -662,10 +662,10 @@ @@ -662,10 +662,10 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-02</td>
<td align="center">M4</td>
<td align="center">2010-02-15</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
@ -674,8 +674,8 @@ @@ -674,8 +674,8 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-05-26</td>
<td align="center">M4</td>
<td align="center">2010-05-10</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -686,35 +686,35 @@ @@ -686,35 +686,35 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-07-15</td>
<td align="center">M4</td>
<td align="center">2010-08-30</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-09-11</td>
<td align="center">M4</td>
<td align="center">2010-09-27</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">5</td>
<td align="center">2010-11-13</td>
<td align="center">M4</td>
<td align="center">2010-10-28</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
@ -722,71 +722,71 @@ @@ -722,71 +722,71 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-11-16</td>
<td align="center">M4</td>
<td align="center">2010-12-01</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-01-03</td>
<td align="center">M4</td>
<td align="center">2011-01-20</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-03-16</td>
<td align="center">M4</td>
<td align="center">2011-02-09</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-04-21</td>
<td align="center">M4</td>
<td align="center">2011-03-08</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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">R</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-24</td>
<td align="center">M4</td>
<td align="center">2011-04-14</td>
<td align="center">W2</td>
<td align="center">B_ESCHR_COL</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>
</tr>
</tbody>
</table>
<p>Instead of 2, now 7 isolates are flagged. In total, of all isolates are marked ‘first weighted’ - 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 8 isolates are flagged. In total, of all isolates are marked ‘first weighted’ - 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="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 14,973 isolates for analysis.</p>
<p>So we end up with 15,032 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb22-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(first, keyab))</a></code></pre></div>
@ -812,93 +812,93 @@ @@ -812,93 +812,93 @@
<tbody>
<tr class="odd">
<td>3</td>
<td align="center">2015-08-15</td>
<td align="center">R1</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">2011-12-06</td>
<td align="center">I5</td>
<td align="center">Hospital C</td>
<td align="center">B_KLBSL_PNE</td>
<td align="center">R</td>
<td align="center">S</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">M</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>4</td>
<td align="center">2012-01-09</td>
<td align="center">X9</td>
<td align="center">2011-03-10</td>
<td align="center">B9</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>5</td>
<td align="center">2014-06-18</td>
<td align="center">Z7</td>
<td align="center">2010-06-27</td>
<td align="center">A2</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</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="even">
<td>6</td>
<td align="center">2015-02-18</td>
<td align="center">F4</td>
<td align="center">2017-12-11</td>
<td align="center">F8</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">R</td>
<td align="center">R</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">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">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>7</td>
<td align="center">2010-11-14</td>
<td align="center">W5</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">S</td>
<td align="center">S</td>
<td>8</td>
<td align="center">2014-06-01</td>
<td align="center">W7</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>8</td>
<td align="center">2010-12-25</td>
<td align="center">F4</td>
<td align="center">Hospital B</td>
<td>9</td>
<td align="center">2017-12-09</td>
<td align="center">A1</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COL</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">M</td>
<td align="center">Gram-negative</td>
@ -925,7 +925,7 @@ @@ -925,7 +925,7 @@
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/clean/topics/freq">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 14,973 (of which NA: 0 = 0.00%)<br>
Length: 15,032 (of which NA: 0 = 0.00%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -942,33 +942,33 @@ Longest: 24</p> @@ -942,33 +942,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,385</td>
<td align="right">49.3%</td>
<td align="right">7,385</td>
<td align="right">49.3%</td>
<td align="right">7,421</td>
<td align="right">49.4%</td>
<td align="right">7,421</td>
<td align="right">49.4%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,709</td>
<td align="right">24.8%</td>
<td align="right">11,094</td>
<td align="right">74.1%</td>
<td align="right">3,771</td>
<td align="right">25.1%</td>
<td align="right">11,192</td>
<td align="right">74.5%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,340</td>
<td align="right">15.6%</td>
<td align="right">13,434</td>
<td align="right">89.7%</td>
<td align="right">2,303</td>
<td align="right">15.3%</td>
<td align="right">13,495</td>
<td align="right">89.8%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,539</td>
<td align="right">10.3%</td>
<td align="right">14,973</td>
<td align="right">1,537</td>
<td align="right">10.2%</td>
<td align="right">15,032</td>
<td align="right">100.0%</td>
</tr>
</tbody>
@ -979,7 +979,7 @@ Longest: 24</p> @@ -979,7 +979,7 @@ Longest: 24</p>
<a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2>
<p>The functions <code><a href="../reference/portion.html">portion_S()</a></code>, <code><a href="../reference/portion.html">portion_SI()</a></code>, <code><a href="../reference/portion.html">portion_I()</a></code>, <code><a href="../reference/portion.html">portion_IR()</a></code> and <code><a href="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (<code><a href="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><a href="../reference/portion.html">portion_SI()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_R</a></span>(AMX)</a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4646363</span></a></code></pre></div>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4640766</span></a></code></pre></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="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -992,19 +992,19 @@ Longest: 24</p> @@ -992,19 +992,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4721851</td>
<td align="center">0.4620994</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4554570</td>
<td align="center">0.4646182</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4683715</td>
<td align="center">0.4689655</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4663838</td>
<td align="center">0.4625253</td>
</tr>
</tbody>
</table>
@ -1022,23 +1022,23 @@ Longest: 24</p> @@ -1022,23 +1022,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4721851</td>
<td align="center">4494</td>
<td align="center">0.4620994</td>
<td align="center">4525</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4554570</td>
<td align="center">5186</td>
<td align="center">0.4646182</td>
<td align="center">5370</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4683715</td>
<td align="center">2229</td>
<td align="center">0.4689655</td>
<td align="center">2175</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4663838</td>
<td align="center">3064</td>
<td align="center">0.4625253</td>
<td align="center">2962</td>
</tr>
</tbody>
</table>
@ -1058,27 +1058,27 @@ Longest: 24</p> @@ -1058,27 +1058,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.9243060</td>
<td align="center">0.8958700</td>
<td align="center">0.9932295</td>
<td align="center">0.9217087</td>
<td align="center">0.8948929</td>
<td align="center">0.9932624</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.8401559</td>
<td align="center">0.8992853</td>
<td align="center">0.9837557</td>
<td align="center">0.8217306</td>
<td align="center">0.9050098</td>
<td align="center">0.9915420</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.9280129</td>
<td align="center">0.9263953</td>
<td align="center">0.9967646</td>
<td align="center">0.9254840</td>
<td align="center">0.9252188</td>
<td align="center">0.9952267</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.6303419</td>
<td align="center">0.6139818</td>
<td align="center">0.0000000</td>
<td align="center">0.6303419</td>
<td align="center">0.6139818</td>
</tr>
</tbody>
</table>

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

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