rcmdcheck
Run R CMD check from R.
Basic Usage
library(rcmdcheck)
# Check current package
rcmdcheck()
# Check specific package
rcmdcheck("path/to/package")
Options
# With arguments
rcmdcheck(args = c("--no-manual", "--as-cran"))
# Build arguments
rcmdcheck(build_args = "--no-build-vignettes")
# Check directory
rcmdcheck(check_dir = "check_output")
Common Arguments
# CRAN-like check
rcmdcheck(args = "--as-cran")
# Skip manual
rcmdcheck(args = "--no-manual")
# Skip vignettes
rcmdcheck(args = "--no-vignettes")
# Skip tests
rcmdcheck(args = "--no-tests")
# Skip examples
rcmdcheck(args = "--no-examples")
# Multiple
rcmdcheck(args = c("--no-manual", "--no-vignettes"))
Results
# Run check
res <- rcmdcheck()
# Access results
res$errors
res$warnings
res$notes
# Status
res$status # 0 = success
# Print summary
print(res)
Error on Issues
# Error if check fails
rcmdcheck(error_on = "error")
# Error on warnings too
rcmdcheck(error_on = "warning")
# Error on notes
rcmdcheck(error_on = "note")
CI Usage
# In CI scripts
rcmdcheck::rcmdcheck(
args = "--no-manual",
error_on = "warning",
check_dir = "check"
)
Compare Checks
# Compare two check results
compare_checks(check1, check2)
# Compare to CRAN
cran_check_results("packagename")
Revdep Checks
# Reverse dependency checks
library(revdepcheck)
revdep_check()