check {devtools} | R Documentation |
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.
check(pkg = ".", document = TRUE, cleanup = TRUE, cran = TRUE, check_version = FALSE, force_suggests = FALSE, args = NULL, build_args = NULL, quiet = FALSE, check_dir = tempdir(), ...)
pkg |
package description, can be path or package name. See
|
document |
if |
cleanup |
if |
cran |
if |
check_version |
Sets |
force_suggests |
Sets |
args, build_args |
An optional character vector of additional command
line arguments to be passed to |
quiet |
if |
check_dir |
the directory in which the package is checked |
... |
Additional arguments passed to |
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.
Devtools does its best to set up an environment that combines best practices with how check works on CRAN. This includes:
The standard environment variables set by devtools:
r_env_vars
. Of particular note for package tests is the
NOT_CRAN
env var which lets you know that your tests are not
running on cran, and hence can take a reasonable amount of time.
Debugging flags for the compiler, set by
compiler_flags(FALSE)
.
If aspell
is found _R_CHECK_CRAN_INCOMING_USE_ASPELL_
is set to TRUE
. If no spell checker is installed, a warning is
issued.)
env vars set by arguments check_version
and
force_suggests
release
if you want to send the checked package to
CRAN.