EVOLUTION-MANAGER
Edit File: r_vanilla.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 an R child process, with no configuration</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 r_vanilla {callr}"><tr><td>r_vanilla {callr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Run an R child process, with no configuration</h2> <h3>Description</h3> <p>It tries to mimic a fresh R installation. In particular: </p> <ul> <li><p> No library path setting. </p> </li> <li><p> No CRAN(-like) repository is set. </p> </li> <li><p> The system and user profiles are not run. </p> </li></ul> <h3>Usage</h3> <pre> r_vanilla( func, args = list(), libpath = character(), repos = c(CRAN = "@CRAN@"), cmdargs = "--slave", system_profile = FALSE, user_profile = FALSE, env = character(), ... ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>func</code></td> <td> <p>Function object to call in the new R process. The function should be self-contained and only refer to other functions and use variables explicitly from other packages using the <code>::</code> notation. By default the environment of the function is set to <code>.GlobalEnv</code> before passing it to the child process. (See the <code>package</code> option if you want to keep the environment.) Because of this, it is good practice to create an anonymous function and pass that to <code>callr</code>, instead of passing a function object from a (base or other) package. In particular </p> <div class="sourceCode"><pre>r(.libPaths) </pre></div> <p>does not work, because <code>.libPaths</code> is defined in a special environment, but </p> <div class="sourceCode"><pre>r(function() .libPaths()) </pre></div> <p>works just fine.</p> </td></tr> <tr valign="top"><td><code>args</code></td> <td> <p>Arguments to pass to the function. Must be a list.</p> </td></tr> <tr valign="top"><td><code>libpath</code></td> <td> <p>The library path.</p> </td></tr> <tr valign="top"><td><code>repos</code></td> <td> <p>The <code>repos</code> option. If <code>NULL</code>, then no <code>repos</code> option is set. This options is only used if <code>user_profile</code> or <code>system_profile</code> is set <code>FALSE</code>, as it is set using the system or the user profile.</p> </td></tr> <tr valign="top"><td><code>cmdargs</code></td> <td> <p>Command line arguments to pass to the R process. Note that <code>c("-f", rscript)</code> is appended to this, <code>rscript</code> is the name of the script file to run. This contains a call to the supplied function and some error handling code.</p> </td></tr> <tr valign="top"><td><code>system_profile</code></td> <td> <p>Whether to use the system profile file.</p> </td></tr> <tr valign="top"><td><code>user_profile</code></td> <td> <p>Whether to use the user's profile file. If this is <code>"project"</code>, then only the profile from the working directory is used, but the <code>R_PROFILE_USER</code> environment variable and the user level profile are not. See also "Security considerations" below.</p> </td></tr> <tr valign="top"><td><code>env</code></td> <td> <p>Environment variables to set for the child process.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments are passed to <code><a href="r.html">r()</a></code>.</p> </td></tr> </table> <h3>Security considerations</h3> <p><code>callr</code> makes a copy of the user's <code>.Renviron</code> file and potentially of the local or user <code>.Rprofile</code>, in the session temporary directory. Avoid storing sensitive information such as passwords, in your environment file or your profile, otherwise this information will get scattered in various files, at least temporarily, until the subprocess finishes. You can use the keyring package to avoid passwords in plain files. </p> <h3>See Also</h3> <p>Other callr functions: <code><a href="r_copycat.html">r_copycat</a>()</code>, <code><a href="r.html">r</a>()</code> </p> <h3>Examples</h3> <pre> # Compare to r() r(function() .libPaths()) r_vanilla(function() .libPaths()) r(function() getOption("repos")) r_vanilla(function() getOption("repos")) </pre> <hr /><div style="text-align: center;">[Package <em>callr</em> version 3.7.2 <a href="00Index.html">Index</a>]</div> </body></html>