check {devtools}R Documentation

Build and check a package, cleaning up automatically on success.

Description

check automatically builds and checks a source package, using all known best practices. Passing R CMD check is essential if you want to submit your package to CRAN: you must not have any ERRORs or WARNINGs, and you want to ensure that there are as few NOTEs as possible. If you are not submitting to CRAN, at least ensure that there are no ERRORs: these typically represent serious problems.

Usage

check(pkg = ".", document = TRUE, cleanup = TRUE, cran = TRUE,
  check_version = FALSE, force_suggests = FALSE, args = NULL,
  build_args = NULL, quiet = FALSE, check_dir = tempdir(), ...)

Arguments

pkg

package description, can be path or package name. See as.package for more information

document

if TRUE (the default), will update and check documentation before running formal check.

cleanup

if TRUE the check directory is removed if the check is successful - this allows you to inspect the results to figure out what went wrong. If FALSE the check directory is never removed.

cran

if TRUE (the default), check using the same settings as CRAN uses.

check_version

Sets _R_CHECK_CRAN_INCOMING_ env var. If TRUE, performns a number of checked related to version numbers of packages on CRAN.

force_suggests

Sets _R_CHECK_FORCE_SUGGESTS_. If FALSE (the default), check will proceed even if all suggested packages aren't found.

args, build_args

An optional character vector of additional command line arguments to be passed to R CMD check/R CMD build/R CMD INSTALL.

quiet

if TRUE suppresses output from this function.

check_dir

the directory in which the package is checked

...

Additional arguments passed to build

Details

check automatically builds a package before using R CMD check as this is the recommended way to check packages. Note that this process runs in an independent realisation of R, so nothing in your current workspace will affect the process.

Environment variables

Devtools does its best to set up an environment that combines best practices with how check works on CRAN. This includes:

See Also

release if you want to send the checked package to CRAN.


[Package devtools version 1.10.0 Index]