EVOLUTION-MANAGER
Edit File: rcmdcheck.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Run R CMD check from R and Capture Results</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for rcmdcheck {rcmdcheck}"><tr><td>rcmdcheck {rcmdcheck}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Run R CMD check from R and Capture Results</h2> <h3>Description</h3> <p>Run R CMD check from R programmatically, and capture the results of the individual checks. </p> <p>Runs <code style="white-space: pre;">R CMD check</code> as an external command, and parses its output and returns the check failures. </p> <h3>Usage</h3> <pre> rcmdcheck( path = ".", quiet = FALSE, args = character(), build_args = character(), check_dir = NULL, libpath = .libPaths(), repos = getOption("repos"), timeout = Inf, error_on = Sys.getenv("RCMDCHECK_ERROR_ON", c("never", "error", "warning", "note")[1]), env = character() ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>path</code></td> <td> <p>Path to a package tarball or a directory.</p> </td></tr> <tr valign="top"><td><code>quiet</code></td> <td> <p>Whether to print check output during checking.</p> </td></tr> <tr valign="top"><td><code>args</code></td> <td> <p>Character vector of arguments to pass to <code style="white-space: pre;">R CMD check</code>. Pass each argument as a single element of this character vector (do not use spaces to delimit arguments like you would in the shell). For example, to skip running of examples and tests, use <code>args = c("--no-examples", "--no-tests")</code> and not <code>args = "--no-examples --no-tests"</code>. (Note that instead of the <code>--output</code> option you should use the <code>check_dir</code> argument, because <code>--output</code> cannot deal with spaces and other special characters on Windows.)</p> </td></tr> <tr valign="top"><td><code>build_args</code></td> <td> <p>Character vector of arguments to pass to <code style="white-space: pre;">R CMD build</code>. Pass each argument as a single element of this character vector (do not use spaces to delimit arguments like you would in the shell). For example, <code>build_args = c("--force", "--keep-empty-dirs")</code> is a correct usage and <code>build_args = "--force --keep-empty-dirs"</code> is incorrect.</p> </td></tr> <tr valign="top"><td><code>check_dir</code></td> <td> <p>Path to a directory where the check is performed. If this is not <code>NULL</code>, then the a temporary directory is used, that is cleaned up when the returned object is garbage collected.</p> </td></tr> <tr valign="top"><td><code>libpath</code></td> <td> <p>The library path to set for the check. The default uses the current library path.</p> </td></tr> <tr valign="top"><td><code>repos</code></td> <td> <p>The <code>repos</code> option to set for the check. This is needed for cyclic dependency checks if you use the <code>--as-cran</code> argument. The default uses the current value.</p> </td></tr> <tr valign="top"><td><code>timeout</code></td> <td> <p>Timeout for the check, in seconds, or as a <a href="../../base/html/difftime.html">base::difftime</a> object. If it is not finished before this, it will be killed. <code>Inf</code> means no timeout. If the check is timed out, that is added as an extra error to the result object.</p> </td></tr> <tr valign="top"><td><code>error_on</code></td> <td> <p>Whether to throw an error on <code style="white-space: pre;">R CMD check</code> failures. Note that the check is always completed (unless a timeout happens), and the error is only thrown after completion. If <code>"never"</code>, then no errors are thrown. If <code>"error"</code>, then only <code>ERROR</code> failures generate errors. If <code>"warning"</code>, then <code>WARNING</code> failures generate errors as well. If <code>"note"</code>, then any check failure generated an error. Its default can be modified with the <code>RCMDCHECK_ERROR_ON</code> environment variable. If that is not set, then <code>"never"</code> is used.</p> </td></tr> <tr valign="top"><td><code>env</code></td> <td> <p>A named character vector, extra environment variables to set in the check process.</p> </td></tr> </table> <h3>Details</h3> <p>See <a href="rcmdcheck_process.html">rcmdcheck_process</a> if you need to run <code style="white-space: pre;">R CMD check</code> in a background process. </p> <h3>Value</h3> <p>An S3 object (list) with fields <code>errors</code>, <code>warnings</code> and <code>notes</code>. These are all character vectors containing the output for the failed check. </p> <h3>Turning off package checks</h3> <p>Sometimes it is useful to programmatically turn off some checks that may report check NOTEs. rcmdcehck provides two ways to do this. </p> <p>First, you may declare in <code>DESCRIPTION</code> that you don't want to see NOTEs that are accepted on CRAN, with this entry:</p> <pre>Config/rcmdcheck/ignore-inconsequential-notes: true </pre> <p>Currently, this will make rcmdcheck ignore the following notes: </p> <ul> <li><p> report large package sizes (<code style="white-space: pre;">_R_CHECK_PKG_SIZES_ = FALSE</code>), </p> </li> <li><p> check cross-references in Rd files (<code style="white-space: pre;">_R_CHECK_RD_XREFS_ = FALSE</code>), </p> </li> <li><p> NOTE if package requires GNU make (<code style="white-space: pre;">_R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_ = FALSE</code>), </p> </li> <li><p> report marked non-ASCII strings in datasets (<code style="white-space: pre;">_R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_ = TRUE</code>). </p> </li></ul> <p>The second way is more flexible, and lets you turn off individual checks via setting environment variables. You may provide a <code>tools/check.env</code> <em>environment file</em> in your package with the list of environment variable settings that rcmdcheck will automatically use when checking the package. See <a href="../../base/html/Startup.html">Startup</a> for the format of this file. </p> <p>Here is an example <code>tools/check.env</code> file:</p> <pre># Report if package size is larger than 10 megabytes _R_CHECK_PKG_SIZES_THRESHOLD_=10 # Do not check Rd cross references _R_CHECK_RD_XREFS_=false # Do not report if package requires GNU make _R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_=false # Do not check non-ASCII strings in datasets _R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_=true </pre> <p>See the <a href="https://cran.r-project.org/doc/manuals/r-devel/R-ints.html">"R internals" manual</a> and the <a href="https://github.com/wch/r-source">R source code</a> for the environment variables that control the checks. </p> <p>Note that <code>Config/rcmdcheck/ignore-inconsequential-notes</code> and the <code>check.env</code> file are only supported by rcmdcheck, and running <code style="white-space: pre;">R CMD check</code> from a shell (or GUI) will not use them. </p> <hr /><div style="text-align: center;">[Package <em>rcmdcheck</em> version 1.4.0 <a href="00Index.html">Index</a>]</div> </body></html>