Browse Source

(v1.4.0.9053) unit test old R versions

main
parent
commit
d3f007bf65
  1. 34
      .github/workflows/check.yaml
  2. 4
      DESCRIPTION
  3. 4
      NEWS.md
  4. 2
      R/ab_from_text.R
  5. 2
      R/mo.R
  6. 9
      R/mo_property.R
  7. 3
      R/zzz.R
  8. 7
      README.md
  9. BIN
      data-raw/AMR_1.4.0.9053.tar.gz
  10. 2
      docs/404.html
  11. 2
      docs/LICENSE-text.html
  12. 486
      docs/articles/AMR.html
  13. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  14. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  15. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  16. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  17. 2
      docs/articles/EUCAST.html
  18. 58
      docs/articles/MDR.html
  19. 2
      docs/articles/PCA.html
  20. 4
      docs/articles/SPSS.html
  21. 2
      docs/articles/WHONET.html
  22. 86
      docs/articles/benchmarks.html
  23. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png
  24. 2
      docs/articles/datasets.html
  25. 2
      docs/articles/index.html
  26. 2
      docs/articles/resistance_predict.html
  27. 2
      docs/articles/welcome_to_AMR.html
  28. 2
      docs/authors.html
  29. 2
      docs/index.html
  30. 12
      docs/news/index.html
  31. 2
      docs/pkgdown.yml
  32. 2
      docs/reference/AMR-deprecated.html
  33. 2
      docs/reference/AMR.html
  34. 2
      docs/reference/WHOCC.html
  35. 2
      docs/reference/WHONET.html
  36. 4
      docs/reference/ab_from_text.html
  37. 2
      docs/reference/ab_property.html
  38. 2
      docs/reference/age.html
  39. 2
      docs/reference/age_groups.html
  40. 2
      docs/reference/antibiotic_class_selectors.html
  41. 2
      docs/reference/antibiotics.html
  42. 2
      docs/reference/as.ab.html
  43. 2
      docs/reference/as.disk.html
  44. 2
      docs/reference/as.mic.html
  45. 2
      docs/reference/as.mo.html
  46. 2
      docs/reference/as.rsi.html
  47. 2
      docs/reference/atc_online.html
  48. 2
      docs/reference/availability.html
  49. 2
      docs/reference/bug_drug_combinations.html
  50. 2
      docs/reference/catalogue_of_life.html
  51. 2
      docs/reference/catalogue_of_life_version.html
  52. 2
      docs/reference/count.html
  53. 4
      docs/reference/eucast_rules.html
  54. 2
      docs/reference/example_isolates.html
  55. 2
      docs/reference/example_isolates_unclean.html
  56. 2
      docs/reference/filter_ab_class.html
  57. 2
      docs/reference/first_isolate.html
  58. 2
      docs/reference/g.test.html
  59. 2
      docs/reference/get_episode.html
  60. 2
      docs/reference/ggplot_pca.html
  61. 2
      docs/reference/ggplot_rsi.html
  62. 2
      docs/reference/guess_ab_col.html
  63. 2
      docs/reference/index.html
  64. 2
      docs/reference/intrinsic_resistant.html
  65. 2
      docs/reference/join.html
  66. 2
      docs/reference/key_antibiotics.html
  67. 2
      docs/reference/kurtosis.html
  68. 2
      docs/reference/lifecycle.html
  69. 2
      docs/reference/like.html
  70. 2
      docs/reference/mdro.html
  71. 2
      docs/reference/microorganisms.codes.html
  72. 2
      docs/reference/microorganisms.html
  73. 2
      docs/reference/microorganisms.old.html
  74. 2
      docs/reference/mo_matching_score.html
  75. 2
      docs/reference/mo_property.html
  76. 2
      docs/reference/mo_source.html
  77. 2
      docs/reference/pca.html
  78. 2
      docs/reference/plot.html
  79. 2
      docs/reference/proportion.html
  80. 2
      docs/reference/random.html
  81. 2
      docs/reference/resistance_predict.html
  82. 2
      docs/reference/rsi_translation.html
  83. 2
      docs/reference/skewness.html
  84. 2
      docs/reference/translate.html
  85. 2
      docs/survey.html
  86. 16
      git_premaster.sh
  87. 2
      man/ab_from_text.Rd
  88. 2
      man/eucast_rules.Rd
  89. 12
      tests/testthat.R

34
.github/workflows/check.yaml

@ -56,16 +56,18 @@ jobs: @@ -56,16 +56,18 @@ jobs:
- {os: windows-latest, r: 'devel', allowfail: false}
- {os: windows-latest, r: 'release', allowfail: false}
- {os: windows-latest, r: 'oldrel', allowfail: false}
- {os: ubuntu-16.04, r: 'devel', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# older R versions cannot be tested, since tidyverse only supports last 4 R x.x versions
- {os: ubuntu-16.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.0', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
@ -80,13 +82,14 @@ jobs: @@ -80,13 +82,14 @@ jobs:
- uses: r-lib/actions/setup-pandoc@master
- name: Query dependencies
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows'
if: runner.os != 'Windows' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
@ -94,7 +97,7 @@ jobs: @@ -94,7 +97,7 @@ jobs:
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-
- name: Install Linux dependencies
if: runner.os == 'Linux'
if: runner.os == 'Linux' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
@ -108,6 +111,7 @@ jobs: @@ -108,6 +111,7 @@ jobs:
brew install mariadb-connector-c
- name: Install dependencies
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
@ -116,15 +120,25 @@ jobs: @@ -116,15 +120,25 @@ jobs:
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
utils::sessionInfo()
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
shell: Rscript {0}
- name: Run R CMD check
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Run R CMD check on older R versions
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2'
env:
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false
run: |
ls -lh
R CMD check data-raw/AMR_*.tar.gz
- name: Show testthat output
if: always()

4
DESCRIPTION

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

4
NEWS.md

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
# AMR 1.4.0.9052
## <small>Last updated: 28 December 2020</small>
# AMR 1.4.0.9053
## <small>Last updated: 29 December 2020</small>
### New
* Functions `get_episode()` and `is_new_episode()` to determine (patient) episodes which are not necessarily based on microorganisms. The `get_episode()` function returns the index number of the episode per group, while the `is_new_episode()` function returns values `TRUE`/`FALSE` to indicate whether an item in a vector is the start of a new episode. They also support `dplyr`s grouping (i.e. using `group_by()`):

2
R/ab_from_text.R

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
#' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name".
#' @param thorough_search logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words.
#' @param ... arguments passed on to [as.ab()]
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned.
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.
#'
#' ## Argument `type`
#' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling.

2
R/mo.R

@ -2006,5 +2006,3 @@ repair_reference_df <- function(reference_df) { @@ -2006,5 +2006,3 @@ repair_reference_df <- function(reference_df) {
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE])
reference_df
}
pkg_env <- new.env(hash = FALSE)

9
R/mo_property.R

@ -433,12 +433,11 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_locale(), ...) { @@ -433,12 +433,11 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_locale(), ...) {
stop_("length of `x` and `ab` must be equal, or one of them must be of length 1.")
}
# show used version number once per session
if (is.null(getOption("AMR_intrinsic_resistance_note", NULL))) {
# show used version number once
if (message_not_thrown_before("intrinsic_resistant_version")) {
message_("Determining intrinsic resistance based on ",
format_eucast_version_nr(3.2, FALSE), ". ",
font_bold("This note is shown only once per session."))
options(AMR_intrinsic_resistance_note = "shown")
format_eucast_version_nr(3.2, markdown = FALSE), ".")
remember_thrown_message("intrinsic_resistant_version")
}
# runs against internal vector: INTRINSIC_R (see zzz.R)

3
R/zzz.R

@ -23,6 +23,9 @@ @@ -23,6 +23,9 @@
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
# set up package environment, used by numerous AMR functions
pkg_env <- new.env(hash = FALSE)
.onLoad <- function(libname, pkgname) {
assign(x = "AB_lookup",

7
README.md

@ -2,8 +2,11 @@ @@ -2,8 +2,11 @@
# `AMR` (for R)
[![CRAN_Badge](https://www.r-pkg.org/badges/version-ago/AMR)](https://cran.R-project.org/package=AMR) [![CRAN_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](https://cran.R-project.org/package=AMR)
[![CodeCov](https://codecov.io/gh/msberends/AMR/branch/master/graph/badge.svg)](https://codecov.io/gh/msberends/AMR/branch/master)
[![CRAN](https://www.r-pkg.org/badges/version-ago/AMR)](https://cran.r-project.org/package=AMR)
[![CRANlogs](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](https://cran.r-project.org/package=AMR)
![R-code-check](https://github.com/msberends/AMR/workflows/R-code-check/badge.svg?branch=master)
[![CodeFactor](https://www.codefactor.io/repository/github/msberends/amr/badge)](https://www.codefactor.io/repository/github/msberends/amr)
[![Codecov](https://codecov.io/gh/msberends/AMR/branch/master/graph/badge.svg)](https://codecov.io/gh/msberends/AMR?branch=master)
<img src="https://msberends.github.io/AMR/works_great_on.png" align="center" height="150px" />

BIN
data-raw/AMR_1.4.0.9053.tar.gz

Binary file not shown.

2
docs/404.html

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

2
docs/LICENSE-text.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9052</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9053</span>
</span>
</div>

486
docs/articles/AMR.html

@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.5.0</span>
</span>
</div>
@ -193,7 +193,7 @@ @@ -193,7 +193,7 @@
<h1 data-toc-skip>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">26 December 2020</h4>
<h4 class="date">29 December 2020</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/AMR.Rmd"><code>vignettes/AMR.Rmd</code></a></small>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -202,7 +202,7 @@ @@ -202,7 +202,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 26 December 2020.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 29 December 2020.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -233,21 +233,21 @@ @@ -233,21 +233,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2020-12-26</td>
<td align="center">2020-12-29</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="center">2020-12-26</td>
<td align="center">2020-12-29</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
</tr>
<tr class="odd">
<td align="center">2020-12-26</td>
<td align="center">2020-12-29</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -352,9 +352,9 @@ @@ -352,9 +352,9 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2011-10-28</td>
<td align="center">I1</td>
<td align="center">Hospital A</td>
<td align="center">2014-02-24</td>
<td align="center">H4</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
@ -363,21 +363,21 @@ @@ -363,21 +363,21 @@
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2011-06-05</td>
<td align="center">G5</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">2017-04-27</td>
<td align="center">Q3</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2014-05-12</td>
<td align="center">X7</td>
<td align="center">Hospital D</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">2013-03-12</td>
<td align="center">Q4</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
@ -385,37 +385,37 @@ @@ -385,37 +385,37 @@
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2011-02-23</td>
<td align="center">K5</td>
<td align="center">2013-03-24</td>
<td align="center">H9</td>
<td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</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">M</td>
</tr>
<tr class="odd">
<td align="center">2017-09-20</td>
<td align="center">T5</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">2017-03-11</td>
<td align="center">M1</td>
<td align="center">Hospital A</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">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-02-10</td>
<td align="center">Y6</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">2011-12-21</td>
<td align="center">M5</td>
<td align="center">Hospital A</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>
</tbody>
</table>
@ -449,16 +449,16 @@ Longest: 1</p> @@ -449,16 +449,16 @@ Longest: 1</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">M</td>
<td align="right">10,426</td>
<td align="right">52.13%</td>
<td align="right">10,426</td>
<td align="right">52.13%</td>
<td align="right">10,444</td>
<td align="right">52.22%</td>
<td align="right">10,444</td>
<td align="right">52.22%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">F</td>
<td align="right">9,574</td>
<td align="right">47.87%</td>
<td align="right">9,556</td>
<td align="right">47.78%</td>
<td align="right">20,000</td>
<td align="right">100.00%</td>
</tr>
@ -503,7 +503,7 @@ Longest: 1</p> @@ -503,7 +503,7 @@ Longest: 1</p>
<span class="co"># NOTE: Using column 'bacteria' as input for `col_mo`.</span>
<span class="co"># NOTE: Using column 'date' as input for `col_date`.</span>
<span class="co"># NOTE: Using column 'patient_id' as input for `col_patient_id`.</span></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>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">&lt;-</span> <span class="va">data</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="va">first</span> <span class="op">==</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div>
@ -515,7 +515,7 @@ Longest: 1</p> @@ -515,7 +515,7 @@ Longest: 1</p>
<div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient F3, 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 Z4, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -531,43 +531,43 @@ Longest: 1</p> @@ -531,43 +531,43 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-17</td>
<td align="center">F3</td>
<td align="center">2010-07-01</td>
<td align="center">Z4</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">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-03-13</td>
<td align="center">F3</td>
<td align="center">2010-08-01</td>
<td align="center">Z4</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">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-04-21</td>
<td align="center">F3</td>
<td align="center">2010-08-18</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">I</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-06-24</td>
<td align="center">F3</td>
<td align="center">2010-10-16</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -575,19 +575,19 @@ Longest: 1</p> @@ -575,19 +575,19 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-02</td>
<td align="center">F3</td>
<td align="center">2010-12-23</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-08-14</td>
<td align="center">F3</td>
<td align="center">2010-12-25</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -597,51 +597,51 @@ Longest: 1</p> @@ -597,51 +597,51 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-10-06</td>
<td align="center">F3</td>
<td align="center">2011-01-07</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2010-10-17</td>
<td align="center">F3</td>
<td align="center">2011-01-30</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2010-11-17</td>
<td align="center">F3</td>
<td align="center">2011-05-19</td>
<td align="center">Z4</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">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-02-21</td>
<td align="center">F3</td>
<td align="center">2011-06-21</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>If a column exists with a name like ‘key(…)ab’ the <code><a href="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">data</span> <span class="op">%&gt;%</span>
@ -665,46 +665,46 @@ Longest: 1</p> @@ -665,46 +665,46 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-17</td>
<td align="center">F3</td>
<td align="center">2010-07-01</td>
<td align="center">Z4</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">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-03-13</td>
<td align="center">F3</td>
<td align="center">2010-08-01</td>
<td align="center">Z4</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">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-04-21</td>
<td align="center">F3</td>
<td align="center">2010-08-18</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">R</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-06-24</td>
<td align="center">F3</td>
<td align="center">2010-10-16</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -713,47 +713,47 @@ Longest: 1</p> @@ -713,47 +713,47 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-02</td>
<td align="center">F3</td>
<td align="center">2010-12-23</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-08-14</td>
<td align="center">F3</td>
<td align="center">2010-12-25</td>
<td align="center">Z4</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">7</td>
<td align="center">2010-10-06</td>
<td align="center">F3</td>
<td align="center">2011-01-07</td>
<td align="center">Z4</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">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">2010-10-17</td>
<td align="center">F3</td>
<td align="center">2011-01-30</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -761,36 +761,36 @@ Longest: 1</p> @@ -761,36 +761,36 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2010-11-17</td>
<td align="center">F3</td>
<td align="center">2011-05-19</td>
<td align="center">Z4</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">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">10</td>
<td align="center">2011-02-21</td>
<td align="center">F3</td>
<td align="center">2011-06-21</td>
<td align="center">Z4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 6 isolates are flagged. In total, 78.5% of all isolates are marked ‘first weighted’ - 50.1% 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 1, now 8 isolates are flagged. In total, 79.0% of all isolates are marked ‘first weighted’ - 50.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="cb19"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">&lt;-</span> <span class="va">data</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
<p>So we end up with 15,695 isolates for analysis.</p>
<p>So we end up with 15,805 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">&lt;-</span> <span class="va">data_1st</span> <span class="op">%&gt;%</span>
@ -800,7 +800,6 @@ Longest: 1</p> @@ -800,7 +800,6 @@ Longest: 1</p>
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">data_1st</span><span class="op">)</span></code></pre></div>
<table class="table">
<colgroup>
<col width="2%">
<col width="8%">
<col width="8%">
<col width="8%">
@ -816,7 +815,6 @@ Longest: 1</p> @@ -816,7 +815,6 @@ Longest: 1</p>
<col width="11%">
</colgroup>
<thead><tr class="header">
<th align="left"></th>
<th align="center">date</th>
<th align="center">patient_id</th>
<th align="center">hospital</th>
@ -833,10 +831,9 @@ Longest: 1</p> @@ -833,10 +831,9 @@ Longest: 1</p>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="center">2011-10-28</td>
<td align="center">I1</td>
<td align="center">Hospital A</td>
<td align="center">2014-02-24</td>
<td align="center">H4</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td align="center">S</td>
@ -849,57 +846,23 @@ Longest: 1</p> @@ -849,57 +846,23 @@ Longest: 1</p>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="center">2011-06-05</td>
<td align="center">G5</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">2017-04-27</td>
<td align="center">Q3</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="center">2014-05-12</td>
<td align="center">X7</td>
<td align="center">Hospital D</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">F</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 align="left">4</td>
<td align="center">2011-02-23</td>
<td align="center">K5</td>
<td align="center">Hospital A</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">M</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 align="left">5</td>
<td align="center">2017-09-20</td>
<td align="center">T5</td>
<td align="center">2013-03-12</td>
<td align="center">Q4</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
@ -913,21 +876,50 @@ Longest: 1</p> @@ -913,21 +876,50 @@ Longest: 1</p>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="left">7</td>
<td align="center">2017-12-17</td>
<td align="center">Z3</td>
<td align="center">Hospital B</td>
<td align="center">2013-03-24</td>
<td align="center">H9</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2017-03-11</td>
<td align="center">M1</td>
<td align="center">Hospital A</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">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>
<tr class="even">
<td align="center">2011-12-21</td>
<td align="center">M5</td>
<td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">S</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-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Time for the analysis!</p>
@ -949,8 +941,8 @@ Longest: 1</p> @@ -949,8 +941,8 @@ Longest: 1</p>
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">genus</span>, <span class="va">species</span><span class="op">)</span></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,695<br>
Available: 15,695 (100%, NA: 0 = 0%)<br>
Length: 15,805<br>
Available: 15,805 (100%, NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -968,32 +960,32 @@ Longest: 24</p> @@ -968,32 +960,32 @@ Longest: 24</p>
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,828</td>
<td align="right">49.88%</td>
<td align="right">49.53%</td>
<td align="right">7,828</td>
<td align="right">49.88%</td>
<td align="right">49.53%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,977</td>
<td align="right">25.34%</td>
<td align="right">11,805</td>
<td align="right">75.22%</td>
<td align="right">3,963</td>
<td align="right">25.07%</td>
<td align="right">11,791</td>
<td align="right">74.60%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,320</td>
<td align="right">14.78%</td>
<td align="right">14,125</td>
<td align="right">90.00%</td>
<td align="right">2,392</td>
<td align="right">15.13%</td>
<td align="right">14,183</td>
<td align="right">89.74%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,570</td>
<td align="right">10.00%</td>
<td align="right">15,695</td>
<td align="right">1,622</td>
<td align="right">10.26%</td>
<td align="right">15,805</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -1020,33 +1012,33 @@ Longest: 24</p> @@ -1020,33 +1012,33 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">AMX</td>
<td align="center">3731</td>
<td align="center">275</td>
<td align="center">3822</td>
<td align="center">3777</td>
<td align="center">245</td>
<td align="center">3806</td>
<td align="center">7828</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">AMC</td>
<td align="center">6146</td>
<td align="center">297</td>
<td align="center">1385</td>
<td align="center">6159</td>
<td align="center">278</td>
<td align="center">1391</td>
<td align="center">7828</td>
</tr>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">5918</td>
<td align="center">5997</td>
<td align="center">0</td>
<td align="center">1910</td>
<td align="center">1831</td>
<td align="center">7828</td>
</tr>
<tr class="even">
<td align="center">E. coli</td>
<td align="center">GEN</td>
<td align="center">7087</td>
<td align="center">6984</td>
<td align="center">0</td>
<td align="center">741</td>
<td align="center">844</td>
<td align="center">7828</td>
</tr>
<tr class="odd">
@ -1054,16 +1046,16 @@ Longest: 24</p> @@ -1054,16 +1046,16 @@ Longest: 24</p>
<td align="center">AMX</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">1570</td>
<td align="center">1570</td>
<td align="center">1622</td>
<td align="center">1622</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">AMC</td>
<td align="center">1231</td>
<td align="center">57</td>
<td align="center">282</td>
<td align="center">1570</td>
<td align="center">1271</td>
<td align="center">63</td>
<td align="center">288</td>
<td align="center">1622</td>
</tr>
</tbody>
</table>
@ -1072,7 +1064,7 @@ Longest: 24</p> @@ -1072,7 +1064,7 @@ Longest: 24</p>
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="va">bacteria</span>, <span class="fu"><a href="../reference/antibiotic_class_selectors.html">fluoroquinolones</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
<pre><code># Selecting fluoroquinolones: 'CIP' (ciprofloxacin)</code></pre>
<pre><code># Selecting fluoroquinolones: column 'CIP' (ciprofloxacin)</code></pre>
<table class="table">
<thead><tr class="header">
<th align="center">mo</th>
@ -1086,34 +1078,34 @@ Longest: 24</p> @@ -1086,34 +1078,34 @@ Longest: 24</p>
<tr class="odd">
<td align="center">E. coli</td>
<td align="center">CIP</td>
<td align="center">5918</td>
<td align="center">5997</td>
<td align="center">0</td>
<td align="center">1910</td>
<td align="center">1831</td>
<td align="center">7828</td>
</tr>
<tr class="even">
<td align="center">K. pneumoniae</td>
<td align="center">CIP</td>
<td align="center">1191</td>
<td align="center">1266</td>
<td align="center">0</td>
<td align="center">379</td>
<td align="center">1570</td>
<td align="center">356</td>
<td align="center">1622</td>
</tr>
<tr class="odd">
<td align="center">S. aureus</td>
<td align="center">CIP</td>
<td align="center">3045</td>
<td align="center">3017</td>
<td align="center">0</td>
<td align="center">932</td>
<td align="center">3977</td>
<td align="center">946</td>
<td align="center">3963</td>
</tr>
<tr class="even">
<td align="center">S. pneumoniae</td>
<td align="center">CIP</td>
<td align="center">1785</td>
<td align="center">1844</td>
<td align="center">0</td>
<td align="center">535</td>
<td align="center">2320</td>
<td align="center">548</td>
<td align="center">2392</td>
</tr>
</tbody>
</table>
@ -1126,7 +1118,7 @@ Longest: 24</p> @@ -1126,7 +1118,7 @@ Longest: 24</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="cb27"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">data_1st</span> <span class="op">%&gt;%</span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span><span class="op">(</span><span class="va">AMX</span><span class="op">)</span>
<span class="co"># [1] 0.536604</span></code></pre></div>
<span class="co"># [1] 0.5358431</span></code></pre></div>
<p>Or can be used in conjuction with <c