banner



How To Run R Cmd Check

check() automatically builds and checks a source package, using all known best practices. check_built() checks an already-built package.

Passing R CMD bank check is essential if you want to submit your package to CRAN: y'all must not take whatsoever ERRORs or WARNINGs, and you lot desire to ensure that there are as few NOTEs every bit possible. If y'all are non submitting to CRAN, at least ensure that in that location are no ERRORs or WARNINGs: these typically represent serious problems.

check() automatically builds a packet before calling check_built(), equally this is the recommended mode to check packages. Notation that this process runs in an independent R session, so nothing in your current workspace will affect the process. Under-the-hood, check() and check_built() rely on pkgbuild::build() and rcmdcheck::rcmdcheck().

Usage

                                                check                  (                                                  pkg                  =                  ".",                                  document                  =                  Nil,                                  build_args                  =                  Goose egg,                                  ...,                                  transmission                  =                  FALSE,                                  cran                  =                  TRUE,                                  remote                  =                  FALSE,                                  incoming                  =                  remote,                                  force_suggests                  =                  FALSE,                                  run_dont_test                  =                  False,                                  args                  =                  "--timings",                                  env_vars                  =                  c                  (NOT_CRAN                  =                  "true"                  ),                                  repose                  =                  FALSE,                                  check_dir                  =                  NULL,                                  cleanup                  =                  deprecated                  (                  ),                                  vignettes                  =                  True,                                  error_on                  =                  c                  (                  "never",                  "fault",                  "warning",                  "annotation"                  )                                                  )                                                                  check_built                  (                                                  path                  =                  Null,                                  cran                  =                  True,                                  remote                  =                  FALSE,                                  incoming                  =                  remote,                                  force_suggests                  =                  Faux,                                  run_dont_test                  =                  False,                                  transmission                  =                  Simulated,                                  args                  =                  "--timings",                                  env_vars                  =                  Aught,                                  check_dir                  =                  tempdir                  (                  ),                                  repose                  =                  False,                                  error_on                  =                  c                  (                  "never",                  "error",                  "warning",                  "note"                  )                                                  )                                          

Arguments

pkg

The packet to use, can be a file path to the bundle or a package object. See as.package() for more information.

document

By default (NULL) will document if your installed roxygen2 version matches the version declared in the DESCRIPTION file. Apply TRUE or Imitation to override the default.

build_args

Boosted arguments passed to R CMD build

...

Boosted arguments passed on to pkgbuild::build().

manual

If FALSE, don't build and check manual (--no-manual).

cran

if Truthful (the default), check using the same settings equally CRAN uses. Considering this is a moving target and is not uniform beyond all of CRAN's auto, this is on a "best endeavour" ground. Information technology is more complicated than simply setting --equally-cran.

remote

Sets _R_CHECK_CRAN_INCOMING_REMOTE_ env var. If TRUE, performs a number of CRAN incoming checks that require remote access.

incoming

Sets _R_CHECK_CRAN_INCOMING_ env var. If TRUE, performs a number of CRAN incoming checks.

force_suggests

Sets _R_CHECK_FORCE_SUGGESTS_. If FALSE (the default), cheque volition continue even if all suggested packages aren't found.

run_dont_test

Sets --run-donttest so that examples surrounded in \donttest{} are also run. When cran = TRUE, this only affects R 3.6 and before; in R 4.0, code in \donttest{} is ever run every bit part of CRAN submission.

args

Grapheme vector of arguments to pass to R CMD check. Pass each argument equally a unmarried element of this graphic symbol vector (practise not use spaces to circumscribe arguments like yous would in the trounce). For example, to skip running of examples and tests, employ args = c("--no-examples", "--no-tests") and not args = "--no-examples --no-tests". (Notation that instead of the --output option you lot should use the check_dir argument, considering --output cannot bargain with spaces and other special characters on Windows.)

env_vars

Surroundings variables set during R CMD cheque

tranquility

if Truthful suppresses output from this function.

check_dir

Path to a directory where the bank check is performed. If this is non Nothing, and so the a temporary directory is used, that is cleaned up when the returned object is garbage collected.

cleanup

[Deprecated] See check_dir for details.

vignettes

If Fake, do non build or check vignettes, equivalent to using args = '--ignore-vignettes' and build_args = '--no-build-vignettes'.

error_on

Whether to throw an fault on R CMD check failures. Note that the cheque is ever completed (unless a timeout happens), and the error is only thrown after completion. If "never", and then no errors are thrown. If "error", and so only Mistake failures generate errors. If "warning", and then WARNING failures generate errors likewise. If "notation", then whatever check failure generated an fault. Its default tin can be modified with the RCMDCHECK_ERROR_ON environment variable. If that is not set, and so "never" is used.

path

Path to built package.

Value

An object containing errors, warnings, notes, and more.

Environment variables

Devtools does its best to set 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 item note for parcel 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(Imitation).

  • 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 gear up by arguments incoming, remote and force_suggests

Come across also

release() if y'all want to ship the checked packet to CRAN.

Source: https://devtools.r-lib.org/reference/check.html

0 Response to "How To Run R Cmd Check"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel