check: Check Package

View source: R/dev.R

checkR Documentation

Check Package

Description

Runs R CMD build and R CMD check on the package.

Usage

check(path = ".", args = c("--as-cran", "--no-manual"),
      error_on = c("warning", "error", "note"))

Arguments

path

Path to package root directory.

args

Character vector of additional arguments to pass to R CMD check. Default includes "–as-cran" and "–no-manual".

error_on

Severity level that causes an error: "error", "warning", or "note". Default is "warning" (fails on errors or warnings).

Value

TRUE if check passes, FALSE otherwise (invisibly). Also throws an error if check fails at or above error_on level.

Examples

# Runs 'R CMD build' + 'R CMD check' (typically tens of seconds).
# Intermediate files go under tempdir(), so nothing is written to the
# caller's working directory. Wrapped in if(interactive()) so the
# example is shown to users but not executed during R CMD check.

if (interactive()) {
  check()
  check(error_on = "error")
  check(args = c("--as-cran", "--no-manual"))
}


tinypkgr documentation built on April 22, 2026, 9:07 a.m.