r-pkg-check
Runs a full package check — the superset check that unit tests alone don’t cover — and triages every NOTE, WARNING, and ERROR it reports before a release or CRAN submission.
Why this exists: devtools::test() only runs unit tests; it says nothing about documentation completeness, example runnability, DESCRIPTION metadata, or the CRAN-policy checks that R CMD check applies. A package whose tests pass can still fail R CMD check on an undocumented argument, a broken \dontrun{} example, or a non-portable file name — issues that only surface by running the full check.
When to run
Before a release, before a CRAN submission, or whenever asked to check a package end to end — not during ordinary iteration (use test for that).
Procedure
Confirm this is an R package. Check that
DESCRIPTIONexists at the repo root. If not, skip — this skill doesn’t apply.Run the same check CI runs:
Rscript -e 'devtools::check()'Check this repo’s own
.github/workflows/for anR CMD check-style job first — if one pins specific flags (e.g.--as-cran,--no-manual), run that exact invocation instead so local results match- Absent such a workflow,
devtools::check()is the default; addargs = "--as-cran"when preparing a CRAN submission specifically (seer-pkg-cran-checklist).
- If
devtoolsisn’t installed:Rscript -e 'install.packages("devtools")'then retry. If R isn’t available at all, fall back to step 5.
- Absent such a workflow,
Triage each NOTE, WARNING, and ERROR:
- Real problem (missing documentation, broken example, undeclared dependency) → fix it in the source.
- A NOTE that’s a known, accepted false positive (e.g. a package name CRAN’s spell-checker doesn’t recognize) → document why in a
cran-comments.mdentry (seer-pkg-cran-checklist) rather than silently ignoring it. - Never leave an ERROR or WARNING unaddressed — both block a CRAN submission and usually indicate a real defect.
Re-run step 2 to confirm a clean check (0 errors, 0 warnings, and every remaining NOTE accounted for) before pushing or submitting.
If R isn’t available, manually review the diff for the shapes
R CMD checkusually flags: new exported functions without@param/@returndocs, examples that call network or interactive code without\dontrun{}/\donttest{}, and new dependencies missing fromDESCRIPTION’sImports/Suggests.