Browse Source

(v0.8.0.9029) cleanup

new-mo-algorithm
parent
commit
d22834c5b8
  1. 2
      DESCRIPTION
  2. 4
      NEWS.md
  3. 1
      R/amr.R
  4. 8
      R/count.R
  5. 4
      R/mdro.R
  6. 6
      R/proportion.R
  7. 2
      R/rsi.R
  8. 8
      appveyor.yml
  9. 2
      docs/404.html
  10. 2
      docs/LICENSE-text.html
  11. 446
      docs/articles/AMR.html
  12. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  13. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  14. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  15. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  16. 4
      docs/articles/EUCAST.html
  17. 62
      docs/articles/MDR.html
  18. 4
      docs/articles/WHONET.html
  19. 2
      docs/articles/index.html
  20. 2
      docs/authors.html
  21. 2
      docs/index.html
  22. 10
      docs/news/index.html
  23. 2
      docs/reference/AMR-deprecated.html
  24. 5
      docs/reference/AMR.html
  25. 4
      docs/reference/as.rsi.html
  26. 2
      docs/reference/availability.html
  27. 14
      docs/reference/count.html
  28. 2
      docs/reference/first_isolate.html
  29. 2
      docs/reference/ggplot_rsi.html
  30. 2
      docs/reference/index.html
  31. 8
      docs/reference/mdro.html
  32. 12
      docs/reference/proportion.html
  33. 1
      man/AMR.Rd
  34. 2
      man/as.rsi.Rd
  35. 10
      man/count.Rd
  36. 4
      man/mdro.Rd
  37. 8
      man/proportion.Rd

2
DESCRIPTION

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Package: AMR
Version: 0.8.0.9028
Version: 0.8.0.9029
Date: 2019-11-10
Title: Antimicrobial Resistance Analysis
Authors@R: c(

4
NEWS.md

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# AMR 0.8.0.9028
# AMR 0.8.0.9029
<small>Last updated: 10-Nov-2019</small>
### New
@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
* The new Verbose mode (`mdro(...., verbose = TRUE)`) returns an informative data set where the reason for MDRO determination is given for every isolate, and an list of the resistant antimicrobial agents
### Changes
* Removed previously deprecated function `as.rsi()` - this function was replaced by `ab_atc()`
* Removed previously deprecated function `as.atc()` - this function was replaced by `ab_atc()`
* Renamed all `portion_*` functions to `proportion_*`. All `portion_*` functions are still available as deprecated functions, and will return a warning when used.
* When running `as.rsi()` over a data set, it will now print the guideline that will be used if it is not specified by the user
* Fix for `eucast_rules()`: *Stenotrophomonas maltophilia* not interpreted "R" to ceftazidime anymore (following EUCAST v3.1)

1
R/amr.R

@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
#' University Medical Center Groningen \cr
#' Post Office Box 30001 \cr
#' 9700 RB Groningen
#' The Netherlands
#'
#' If you have found a bug, please file a new issue at: \cr
#' \url{https://gitlab.com/msberends/AMR/issues}

8
R/count.R

@ -23,17 +23,17 @@ @@ -23,17 +23,17 @@
#'
#' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}.
#'
#' \code{count_resistant} should be used to count resistant isolates, \code{count_susceptible} should be used to count susceptible isolates.\cr
#' \code{count_resistant()} should be used to count resistant isolates, \code{count_susceptible()} should be used to count susceptible isolates.\cr
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed.
#' @inheritParams proportion
#' @inheritSection as.rsi Interpretation of S, I and R
#' @details These functions are meant to count isolates. Use the \code{\link{resistance}}/\code{\link{susceptibility}} functions to calculate microbial resistance/susceptibility.
#'
#' The function \code{count_resistant} is equal to the function \code{count_R}. The function \code{count_susceptible} is equal to the function \code{count_SI}.
#' The function \code{count_resistant()} is equal to the function \code{count_R()}. The function \code{count_susceptible()} is equal to the function \code{count_SI()}.
#'
#' The function \code{n_rsi} is an alias of \code{count_all}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}.
#' The function \code{n_rsi()} is an alias of \code{count_all()}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}.
#'
#' The function \code{count_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and counts the number of S's, I's and R's. The function \code{rsi_df} works exactly like \code{count_df}, but adds the percentage of S, I and R.
#' The function \code{count_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and counts the number of S's, I's and R's. The function \code{rsi_df()} works exactly like \code{count_df()}, but adds the percentage of S, I and R.
#' @inheritSection proportion Combination therapy
#' @seealso \code{\link{proportion}_*} to calculate microbial resistance and susceptibility.
#' @return Integer

4
R/mdro.R

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
#' Determine multidrug-resistant organisms (MDRO)
#'
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to (country-specific) guidelines.
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.
#' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, see Details.
#' @param info print progress
#' @inheritParams eucast_rules
@ -637,7 +637,7 @@ mdro <- function(x, @@ -637,7 +637,7 @@ mdro <- function(x,
which(x$genus == "Staphylococcus" & x$species == "aureus"),
c(OXA, FOX),
"any")
trans_tbl2(paste("Table 1 -", italic("S. aureus")),
trans_tbl2(paste("Table 1 -", italic("Staphylococcus aureus")),
which(x$genus == "Staphylococcus" & x$species == "aureus"),
list(GEN,
RIF,

6
R/proportion.R

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
#'
#' @description These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}.
#'
#' \code{resistance} should be used to calculate resistance, \code{susceptibility} should be used to calculate susceptibility.\cr
#' \code{resistance()} should be used to calculate resistance, \code{susceptibility()} should be used to calculate susceptibility.\cr
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.
#' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.
#' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.
@ -35,13 +35,13 @@ @@ -35,13 +35,13 @@
#' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.
#' @inheritSection as.rsi Interpretation of S, I and R
#' @details
#' The function \code{resistance} is equal to the function \code{proportion_R}. The function \code{susceptibility} is equal to the function \code{proportion_SI}.
#' The function \code{resistance()} is equal to the function \code{proportion_R()}. The function \code{susceptibility()} is equal to the function \code{proportion_SI()}.
#'
#' \strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link{first_isolate}} to determine them in your data set.
#'
#' These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. The function \code{susceptibility()} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can infuence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).}
#'
#' The function \code{proportion_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and calculates the proportions R, I and S. The function \code{rsi_df} works exactly like \code{proportion_df}, but adds the number of isolates.
#' The function \code{proportion_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and calculates the proportions R, I and S. The function \code{rsi_df()} works exactly like \code{proportion_df()}, but adds the number of isolates.
#' @section Combination therapy:
#' When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{susceptibility} works to calculate the \%SI:
#'

2
R/rsi.R

@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
#'
#' Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
#'
#' This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates.
#' This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates.
#' @return Ordered factor with new class \code{rsi}
#' @aliases RSI
#' @export

8
appveyor.yml

@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
# Download script file from GitHub
# Download script file from this GitLab repo
init:
ps: |
$ErrorActionPreference = "Stop"
Invoke-WebRequest https://gitlab.com/msberends/AMR/raw/premaster/tests/appveyor/appveyor_tool.ps1 -OutFile "..\appveyor-tool.ps1"
Invoke-WebRequest https://gitlab.com/msberends/AMR/raw/master/tests/appveyor/appveyor_tool.ps1 -OutFile "..\appveyor-tool.ps1"
Import-Module '..\appveyor-tool.ps1'
install:
@ -44,11 +44,11 @@ environment: @@ -44,11 +44,11 @@ environment:
matrix:
- R_VERSION: oldrel
- R_VERSION: release
- R_VERSION: devel # 9 nov 19: searches for R 4.0 and now fails...
- R_VERSION: devel
matrix:
allow_failures:
- R_VERSION: "devel"
- R_VERSION: "devel" # 9 nov 19: searches for R 4.0 and now fails...
build_script:
- travis_tool.sh install_deps

2
docs/404.html

@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9028</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9029</span>
</span>
</div>

2
docs/LICENSE-text.html

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

446
docs/articles/AMR.html

@ -41,7 +41,7 @@ @@ -41,7 +41,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.8.0.9027</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9029</span>
</span>
</div>
@ -321,70 +321,70 @@ @@ -321,70 +321,70 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2016-01-11</td>
<td align="center">N1</td>
<td align="center">Hospital C</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">2015-05-08</td>
<td align="center">P3</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2010-12-17</td>
<td align="center">D2</td>
<td align="center">Hospital D</td>
<td align="center">2017-11-03</td>
<td align="center">Y8</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2016-07-05</td>
<td align="center">L5</td>
<td align="center">2013-09-06</td>
<td align="center">U9</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2016-12-23</td>
<td align="center">C5</td>
<td align="center">Hospital A</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">R</td>
<td align="center">2015-11-16</td>
<td align="center">E7</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2011-06-29</td>
<td align="center">F3</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">2011-04-18</td>
<td align="center">F4</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2011-07-01</td>
<td align="center">N10</td>
<td align="center">Hospital A</td>
<td align="center">2010-04-22</td>
<td align="center">L4</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
</tbody>
</table>
@ -406,8 +406,8 @@ @@ -406,8 +406,8 @@
#
# Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- -------------
# 1 M 10,264 51.32% 10,264 51.32%
# 2 F 9,736 48.68% 20,000 100.00%</code></pre>
# 1 M 10,417 52.09% 10,417 52.09%
# 2 F 9,583 47.92% 20,000 100.00%</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="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-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="cb14-18" data-line-number="18"><span class="co"># Pasteurella multocida (no changes)</span></a>
<a class="sourceLine" id="cb14-19" data-line-number="19"><span class="co"># Staphylococcus (no changes)</span></a>
<a class="sourceLine" id="cb14-20" data-line-number="20"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<a class="sourceLine" id="cb14-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,477 values changed)</span></a>
<a class="sourceLine" id="cb14-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,545 values changed)</span></a>
<a class="sourceLine" id="cb14-22" data-line-number="22"><span class="co"># Viridans group streptococci (no changes)</span></a>
<a class="sourceLine" id="cb14-23" data-line-number="23"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-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="cb14-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,306 values changed)</span></a>
<a class="sourceLine" id="cb14-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,309 values changed)</span></a>
<a class="sourceLine" id="cb14-26" data-line-number="26"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-27" data-line-number="27"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,791 values changed)</span></a>
<a class="sourceLine" id="cb14-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,733 values changed)</span></a>
<a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -452,24 +452,24 @@ @@ -452,24 +452,24 @@
<a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># Other rules</span></a>
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,203 values changed)</span></a>
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (104 values changed)</span></a>
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,194 values changed)</span></a>
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (121 values changed)</span></a>
<a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
<a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-43" data-line-number="43"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,529 out of 20,000 rows, making a total of 7,881 edits</span></a>
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,489 out of 20,000 rows, making a total of 7,902 edits</span></a>
<a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># =&gt; changed 7,881 test results</span></a>
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># - 102 test results changed from S to I</span></a>
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># - 4,800 test results changed from S to R</span></a>
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># - 1,035 test results changed from I to S</span></a>
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 291 test results changed from I to R</span></a>
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 1,625 test results changed from R to S</span></a>
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 28 test results changed from R to I</span></a>
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># =&gt; changed 7,902 test results</span></a>
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># - 118 test results changed from S to I</span></a>
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># - 4,776 test results changed from S to R</span></a>
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># - 1,063 test results changed from I to S</span></a>
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 318 test results changed from I to R</span></a>
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 1,603 test results changed from R to S</span></a>
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 24 test results changed from R to I</span></a>
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-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,8 +497,8 @@ @@ -497,8 +497,8 @@
<a class="sourceLine" id="cb16-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="cb16-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="cb16-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="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,674 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,696 first isolates (28.5% of total)</span></a></code></pre></div>
<p>So only 28.5% 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="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-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="cb17-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>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -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 S8, 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 P1, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -524,19 +524,19 @@ @@ -524,19 +524,19 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-27</td>
<td align="center">S8</td>
<td align="center">2010-01-26</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</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">2</td>
<td align="center">2010-06-01</td>
<td align="center">S8</td>
<td align="center">2010-04-19</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -546,30 +546,30 @@ @@ -546,30 +546,30 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-09-13</td>
<td align="center">S8</td>
<td align="center">2010-04-24</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-09-27</td>
<td align="center">S8</td>
<td align="center">2010-06-11</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-10-15</td>
<td align="center">S8</td>
<td align="center">2010-11-24</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -579,8 +579,8 @@ @@ -579,8 +579,8 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-12-25</td>
<td align="center">S8</td>
<td align="center">2010-12-11</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -590,19 +590,19 @@ @@ -590,19 +590,19 @@
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-02-06</td>
<td align="center">S8</td>
<td align="center">2010-12-23</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-03-27</td>
<td align="center">S8</td>
<td align="center">2011-01-14</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -612,25 +612,25 @@ @@ -612,25 +612,25 @@
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-05-14</td>
<td align="center">S8</td>
<td align="center">2011-01-19</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-09-12</td>
<td align="center">S8</td>
<td align="center">2011-01-26</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
@ -645,7 +645,7 @@ @@ -645,7 +645,7 @@
<a class="sourceLine" id="cb19-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="cb19-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="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,253 first weighted isolates (76.3% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,241 first weighted isolates (76.2% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -662,56 +662,56 @@ @@ -662,56 +662,56 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-27</td>
<td align="center">S8</td>
<td align="center">2010-01-26</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</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">2</td>
<td align="center">2010-06-01</td>
<td align="center">S8</td>
<td align="center">2010-04-19</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-09-13</td>
<td align="center">S8</td>
<td align="center">2010-04-24</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</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="even">
<td align="center">4</td>
<td align="center">2010-09-27</td>
<td align="center">S8</td>
<td align="center">2010-06-11</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-10-15</td>
<td align="center">S8</td>
<td align="center">2010-11-24</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -722,8 +722,8 @@ @@ -722,8 +722,8 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-12-25</td>
<td align="center">S8</td>
<td align="center">2010-12-11</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -734,35 +734,35 @@ @@ -734,35 +734,35 @@
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-02-06</td>
<td align="center">S8</td>
<td align="center">2010-12-23</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">TRUE</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-27</td>
<td align="center">S8</td>
<td align="center">2011-01-14</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-05-14</td>
<td align="center">S8</td>
<td align="center">2011-01-19</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -770,23 +770,23 @@ @@ -770,23 +770,23 @@
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-09-12</td>
<td align="center">S8</td>
<td align="center">2011-01-26</td>
<td align="center">P1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 6 isolates are flagged. In total, 76.3% of all isolates are marked ‘first weighted’ - 47.9% 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 10 isolates are flagged. In total, 76.2% of all isolates are marked ‘first weighted’ - 47.7% 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="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-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="cb20-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 15,253 isolates for analysis.</p>
<p>So we end up with 15,241 isolates for analysis.</p>
<p>We can remove unneeded columns:</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_1st <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="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
@ -811,16 +811,16 @@ @@ -811,16 +811,16 @@
</tr></thead>
<tbody>
<tr class="odd">
<td>2</td>
<td align="center">2010-12-17</td>
<td align="center">D2</td>
<td align="center">Hospital D</td>
<td>1</td>
<td align="center">2015-05-08</td>
<td align="center">P3</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
@ -828,82 +828,82 @@ @@ -828,82 +828,82 @@
</tr>
<tr class="even">
<td>3</td>
<td align="center">2016-07-05</td>
<td align="center">L5</td>
<td align="center">2013-09-06</td>
<td align="center">U9</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>4</td>
<td align="center">2016-12-23</td>
<td align="center">C5</td>
<td align="center">Hospital A</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td>
<td>5</td>
<td align="center">2011-04-18</td>
<td align="center">F4</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</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="even">
<td>5</td>
<td align="center">2011-06-29</td>
<td align="center">F3</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</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-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td>7</td>
<td align="center">2016-10-10</td>
<td align="center">S10</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</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">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2011-07-01</td>
<td align="center">N10</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td>8</td>
<td align="center">2010-01-21</td>
<td align="center">R3</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">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="even">
<td>8</td>
<td align="center">2010-01-02</td>
<td align="center">X9</td>
<td>9</td>
<td align="center">2011-11-23</td>
<td align="center">B7</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -925,7 +925,7 @@ @@ -925,7 +925,7 @@
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,253 (of which NA: 0 = 0%)<br>
Length: 15,241 (of which NA: 0 = 0%)<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,529</td>
<td align="right">49.36%</td>
<td align="right">7,529</td>
<td align="right">49.36%</td>
<td align="right">7,593</td>
<td align="right">49.82%</td>
<td align="right">7,593</td>
<td align="right">49.82%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,765</td>
<td align="right">24.68%</td>
<td align="right">11,294</td>
<td align="right">74.04%</td>
<td align="right">3,734</td>
<td align="right">24.50%</td>
<td align="right">11,327</td>
<td align="right">74.32%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,350</td>
<td align="right">15.41%</td>
<td align="right">13,644</td>
<td align="right">89.45%</td>
<td align="right">2,327</td>
<td align="right">15.27%</td>
<td align="right">13,654</td>
<td align="right">89.59%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,609</td>
<td align="right">10.55%</td>
<td align="right">15,253</td>
<td align="right">1,587</td>
<td align="right">10.41%</td>
<td align="right">15,241</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -980,7 +980,7 @@ Longest: 24</p> @@ -980,7 +980,7 @@ Longest: 24</p>
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="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="../reference/proportion.html">resistance</a></span>(AMX)</a>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4715794</span></a></code></pre></div>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4724099</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="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></a>
<a class="sourceLine" id="cb26-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>
@ -993,19 +993,19 @@ Longest: 24</p> @@ -993,19 +993,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4697103</td>
<td align="center">0.4637681</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4727821</td>
<td align="center">0.4776811</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4739112</td>
<td align="center">0.4811697</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4705116</td>
<td align="center">0.4694820</td>
</tr>
</tbody>
</table>
@ -1023,23 +1023,23 @@ Longest: 24</p> @@ -1023,23 +1023,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4697103</td>
<td align="center">4556</td>
<td align="center">0.4637681</td>
<td align="center">4554</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4727821</td>
<td align="center">5309</td>
<td align="center">0.4776811</td>
<td align="center">5399</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4739112</td>
<td align="center">2319</td>
<td align="center">0.4811697</td>
<td align="center">2257</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4705116</td>
<td align="center">3069</td>
<td align="center">0.4694820</td>
<td align="center">3031</td>
</tr>
</tbody>
</table>
@ -1059,27 +1059,27 @@ Longest: 24</p> @@ -1059,27 +1059,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.9246912</td>
<td align="center">0.8918847</td>
<td align="center">0.9929606</td>
<td align="center">0.9212433</td>
<td align="center">0.8984591</td>
<td align="center">0.9927565</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.8309509</td>
<td align="center">0.9030454</td>
<td align="center">0.9869484</td>
<td align="center">0.8298677</td>
<td align="center">0.8897290</td>
<td align="center">0.9836169</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.9301461</td>
<td align="center">0.9189907</td>
<td align="center">0.9933599</td>
<td align="center">0.9290305</td>
<td align="center">0.9258168</td>
<td align="center">0.9946438</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.6251064</td>
<td align="center">0.6067899</td>
<td align="center">0.0000000</td>
<td align="center">0.6251064</td>
<td align="center">0.6067899</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: 64 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

4
docs/articles/EUCAST.html

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