(v3.0.1.9116) New sir_combine() for combination therapy as one engine for antibiogram(), wisca(), count_*() and proportion_*() (#321), and make all suggested packages runtime-only with a new CI workflow without dplyr

- New sir_combine() to combine SIR results of multiple antimicrobials into one variable; antibiogram(), wisca() and the count/proportion functions now use the same engine (antibiogram() and wisca() output unchanged)
- With multiple antimicrobials, count_*() and proportion_*() now follow the documented combination therapy rules: resistance() is the proportion of failing combinations, count_all() excludes isolates with an unknown combination result, and WT/NWT/NS/NI are handled correctly
- where() is now decided at runtime instead of at installation, fixing antibiogram() and wisca() without tidyselect (e.g. CRAN binaries without dplyr)
- Imports from data.table and cli moved to .onLoad(); data.table functions are only used while it is loaded; the like() example no longer unloads data.table, which crashed R
- Static test that fails on code outside functions depending on suggested packages
- New check-without-dplyr workflow: installs AMR with all suggested packages, removes dplyr (and tidyselect), then runs all unit tests and examples against the installed package
- g.test() now returns the degrees of freedom as 'parameter', so they are printed
- Fix R CMD check NOTEs (hidden .claude folder, lost braces in inherited g.test and ggplot_pca docs)
This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-10-11 20:36:31 +02:00
1 parent 80afedeb8c
commit 53d0704271
30 files changed
+939 -268

No files matched your search

+4
View File
@@ -45,6 +45,10 @@ test_that("test-g.test.R", {
0.017873,
tolerance = 0.0001
)
# degrees of freedom are returned as the standard 'htest' component, so print() shows them
expect_identical(g.test(x)$parameter, c(df = 1))
expect_identical(names(g.test(matrix(c(762, 327, 468, 484, 239, 477), nrow = 2))$parameter), "df")
expect_equal(unname(g.test(matrix(c(762, 327, 468, 484, 239, 477), nrow = 2))$parameter), 2)
expect_error(g.test(0))
expect_error(g.test(c(0, 1), 0))