Skip to content
Latchkey

R "R CMD check" returns ERROR in CI

R CMD check ran the package checks and at least one returned ERROR, so the overall status is "1 ERROR" and the job fails. The failing check (examples, tests, or vignettes) is named in the log just above the summary.

What this error means

The check job ends with "Status: 1 ERROR" (sometimes plus warnings or notes). On GitHub Actions the r-lib/actions check-r-package step then exits non-zero.

R
* checking examples ... ERROR
Running examples in 'mypkg-Ex.R' failed
The error most likely occurred in:
> ### Name: do_thing
Error in do_thing(NULL) : argument "x" is missing, with no default
Status: 1 ERROR, 1 WARNING, 2 NOTEs

Common causes

An example, test, or vignette errored

A runnable example, a testthat test, or a vignette chunk threw an error during the check, which R CMD check reports as a hard ERROR.

A check stricter in CI than locally

CI runs with --as-cran or error_on = "error", surfacing failures that an interactive local build skipped.

How to fix it

Read the failing section and fix the code

  1. Find the "... ERROR" line and the section it names (examples, tests, vignettes).
  2. Reproduce locally with the same check level.
  3. Fix the failing example or test, then re-run the check.
Terminal
Rscript -e 'rcmdcheck::rcmdcheck(args="--no-manual", error_on="error")'

Match the CI check arguments locally

Run the same arguments the workflow uses so the failure reproduces before you push.

Terminal
R CMD build .
R CMD check mypkg_*.tar.gz --as-cran

How to prevent it

  • Run R CMD check --as-cran locally before pushing.
  • Keep examples and vignettes runnable with valid inputs.
  • Treat check warnings as failures so they do not become errors later.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →