Skip to content

Prepare chefStats for CRAN submission#21

Open
NNcino wants to merge 7 commits into
mainfrom
feature/CRAN_submission
Open

Prepare chefStats for CRAN submission#21
NNcino wants to merge 7 commits into
mainfrom
feature/CRAN_submission

Conversation

@NNcino

@NNcino NNcino commented May 27, 2026

Copy link
Copy Markdown
Collaborator

This PR completes all necessary changes to prepare the {chefStats} package for CRAN submission, addressing blockers and likely CRAN notes/warnings.

Changes Made

Blockers (CRAN rejection prevention)

  • Remove testr dependency — Removed Remotes: field and testr from Suggests: (testr is not on CRAN)
  • Replace with withr — Updated tests/testthat/test-use_chefStats.R to use withr::local_tempdir() and withr::local_dir() instead of testr::create_local_project()
  • Add examples to all exported functions — Added \examples{} sections to all 25 exported function documentation files, with small inline data.table examples tailored to each
    function
  • Mark internal functions — Added @keywords internal to barnard_test_ and breslowdaytest_ to exclude them from public exports

Likely Notes / Warnings (CRAN reviewer pushback prevention)

  • DESCRIPTION metadata fixes:
    • Title case: "Provide Methods for Different Statistics"
    • Expanded Description field with fuller context (clinical trial, demographics, chef pipeline)
    • Added BugReports: field pointing to GitHub issues
    • Removed redundant explicit Maintainer: field (relying on Authors@R)
    • Fixed Imports: indentation (DescTools was using tabs instead of spaces)
    • Added withr to Suggests:
  • README.md — Fixed URL redirects by adding trailing slashes to GitHub Pages URLs

Files Modified

  • DESCRIPTION — metadata updates and dependency fixes
  • tests/testthat/test-use_chefStats.R — replaced testr with withr
  • R/*.R — added roxygen comments with @examples and @Keywords internal where needed
  • man/*.Rd — auto-generated from roxygen (examples and internal markings)
  • README.md — fixed URL redirects

CRAN Compliance Status

All CRAN blockers and likely notes have been addressed. Ready for local check (R CMD check --as-cran .) and CRAN submission via rhub::check_for_cran().

Testing

  • All 25 exported functions now have working examples
  • Internal functions properly marked as internal
  • Test suite updated to use CRAN-approved withr package

NNcino and others added 6 commits April 16, 2026 15:12
- Remove Remotes block from DESCRIPTION
- Remove testr from Suggests, add withr
- Fix DescTools indentation in Imports
- Replace testr::create_local_project() in test-use_chefStats.R with
  withr::local_tempdir() + withr::local_dir()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Title case: "Provide Methods for Different Statistics"
- Expand Description to 3 sentences
- Add BugReports field
- Remove redundant Maintainer field (Authors@R cre role is sufficient)
- Tidy URL field indentation, remove codecov URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These functions have man pages but are not exported. Adding
@Keywords internal suppresses the R CMD check note about objects
in 'man' that are not exported.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add \examples{} to all 25 exported .Rd files
- Add @examples to all corresponding R source files
- Remove duplicate mean_value definition from by_strata_by_trt.R
  (first definition had wrong @return description and used J() instead
  of list() for key lookup; second definition is the correct one)
- Clean up duplicate \usage{} and \value{} entries in mean_value.Rd

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mnog

- Add "J" to globalVariables() to suppress 'no visible global function
  definition for J' NOTE in obs_time_by_trt and sd_value
- Replace bare {ramnog} with \pkg{ramnog} in 19 Rd files and all
  corresponding R source files to fix 'Lost braces' checkRd warnings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…URLs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NNcino NNcino requested a review from matthew-phelps May 27, 2026 12:49
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

Test Results

 1 files   7 suites   17s ⏱️
30 tests 30 ✅ 0 💤 0 ❌
74 runs  74 ✅ 0 💤 0 ❌

Results for commit 7c8bb99.

♻️ This comment has been updated with latest results.

Adds Remotes: hta-pharma/chef@feature/CRAN_submission so GitHub Actions can
resolve {chef} from GitHub during CI (it is not yet on CRAN). CRAN forbids
Remotes: in submitted tarballs, so tools/strip-remotes.R removes the field
before R CMD build. The helper restores DESCRIPTION afterwards when invoked
with --build, leaving the working tree unchanged.

Both tools/ and cran-plan.md are ignored at build time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Code coverage

Name Coverage (%)
chefStats 79.51
R/across_strata_across_trt.R 38.33
R/barnard_test.R 90.91
R/BreslowDayFunction.R 100.00
R/building_blocks.R 91.67
R/by_strata_across_trt.R 97.14
R/by_strata_by_trt.R 95.94
R/fisher_vs_barnard.R 100.00
R/hedges_g_.R 0.00
R/odds_ratio_amnog.R 92.31
R/relative_risk.R 100.00
R/risk_diff.R 100.00
R/two_by_two_x.R 77.61
R/use_chefStats.R 47.17
R/utils.R 0.00
R/validate_breslow_day.R 82.35

@github-actions

Copy link
Copy Markdown

Github pages

Review the pkgdown webpage for the PR here

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