Skip to content

Fix CRAN issues, add test suite, and fix correctness bugs#1

Merged
ehsanx merged 1 commit into
mainfrom
improve/test-and-fix
Jun 16, 2026
Merged

Fix CRAN issues, add test suite, and fix correctness bugs#1
ehsanx merged 1 commit into
mainfrom
improve/test-and-fix

Conversation

@ehsanx

@ehsanx ehsanx commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Resolves the three CRAN reviewer issues and hardens the package with a real test suite and several correctness fixes. R CMD check --as-cran --run-donttest is clean (0 errors, 0 warnings, 1 expected dev-version NOTE).

CRAN compliance:

  • DESCRIPTION: add method references with 9 verified DOIs/ISBN; bump to 0.14.1.9000.
  • pipe.Rd: add \value (was the only missing \value tag).
  • Convert all 7 \dontrun examples to \donttest on the bundled nhanes_mortality data (examples no longer need the NHANES Suggests pkg).
  • Strengthen every \value to name the actual runtime class and meaning (e.g. svypooled is c("kableExtra","knitr_kable")).

Correctness fixes:

  • svygof: attach decile groups to the existing design via stats::update() instead of rebuilding a bare svydesign; preserves fpc/calibration and now works on replicate designs (previously errored). Fix the example, which called svyAUC, and the @param design doc.
  • svyAUC: replace hardcoded 1.96 with a design-df qt() critical value and build the CI on the logit scale so it stays within [0,1]; remove dead code.
  • svycoxph_CE_mi: default time_var/status_var followup/death -> stime/status (the old defaults did not exist in the bundled data).
  • svytable1: error on a 0-row design instead of returning a fake table; stop flooring the design effect at 1 (was over-suppressing deff<1 cells).
  • README: rewrite to the real APIs on bundled data (the Cox and plotint examples documented signatures that do not exist); every snippet verified.

New functionality:

  • svykmplot gains an se argument (default TRUE). se = FALSE skips the slow survey-weighted CI bands (28s -> 0.3s on the example data).

Testing & hygiene:

  • Replace the trivial smoke test with a real testthat suite: 67 passing assertions across descriptive tables, diagnostics, additive interaction (tightly pinned pure-math RERI/AP/S), survival, and MI pooling, rooted on the bundled data with edge-case coverage.
  • Clean up .data$ usage inside tidyselect verbs (removes ~258 deprecation warnings); gate addintlist progress messages behind verbose.
  • Untrack R/.Rhistory; ignore *.Rhistory and Rplots.pdf; fix URL trailing slash; keep NEWS.md/cran-comments.md out of the *.md gitignore.

Resolves the three CRAN reviewer issues and hardens the package with a
real test suite and several correctness fixes. R CMD check --as-cran
--run-donttest is clean (0 errors, 0 warnings, 1 expected dev-version NOTE).

CRAN compliance:
- DESCRIPTION: add method references with 9 verified DOIs/ISBN; bump to
  0.14.1.9000.
- pipe.Rd: add \value (was the only missing \value tag).
- Convert all 7 \dontrun examples to \donttest on the bundled
  nhanes_mortality data (examples no longer need the NHANES Suggests pkg).
- Strengthen every \value to name the actual runtime class and meaning
  (e.g. svypooled is c("kableExtra","knitr_kable")).

Correctness fixes:
- svygof: attach decile groups to the existing design via stats::update()
  instead of rebuilding a bare svydesign; preserves fpc/calibration and now
  works on replicate designs (previously errored). Fix the example, which
  called svyAUC, and the @param design doc.
- svyAUC: replace hardcoded 1.96 with a design-df qt() critical value and
  build the CI on the logit scale so it stays within [0,1]; remove dead code.
- svycoxph_CE_mi: default time_var/status_var followup/death -> stime/status
  (the old defaults did not exist in the bundled data).
- svytable1: error on a 0-row design instead of returning a fake table;
  stop flooring the design effect at 1 (was over-suppressing deff<1 cells).
- README: rewrite to the real APIs on bundled data (the Cox and plotint
  examples documented signatures that do not exist); every snippet verified.

New functionality:
- svykmplot gains an `se` argument (default TRUE). se = FALSE skips the slow
  survey-weighted CI bands (28s -> 0.3s on the example data).

Testing & hygiene:
- Replace the trivial smoke test with a real testthat suite: 67 passing
  assertions across descriptive tables, diagnostics, additive interaction
  (tightly pinned pure-math RERI/AP/S), survival, and MI pooling, rooted on
  the bundled data with edge-case coverage.
- Clean up .data$ usage inside tidyselect verbs (removes ~258 deprecation
  warnings); gate addintlist progress messages behind verbose.
- Untrack R/.Rhistory; ignore *.Rhistory and Rplots.pdf; fix URL trailing
  slash; keep NEWS.md/cran-comments.md out of the *.md gitignore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ehsanx ehsanx merged commit 0aab7e3 into main Jun 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant