EVOLUTION-MANAGER
Edit File: dump.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: Text Representations of R Objects</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 dump {base}"><tr><td>dump {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Text Representations of R Objects</h2> <h3>Description</h3> <p>This function takes a vector of names of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects and produces text representations of the objects on a file or connection. A <code>dump</code> file can usually be <code><a href="source.html">source</a></code>d into another <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session. </p> <h3>Usage</h3> <pre> dump(list, file = "dumpdata.R", append = FALSE, control = "all", envir = parent.frame(), evaluate = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>list</code></td> <td> <p>character vector. The names of one or more <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects to be dumped.</p> </td></tr> <tr valign="top"><td><code>file</code></td> <td> <p>either a character string naming a file or a <a href="connections.html">connection</a>. <code>""</code> indicates output to the console.</p> </td></tr> <tr valign="top"><td><code>append</code></td> <td> <p>if <code>TRUE</code> and <code>file</code> is a character string, output will be appended to <code>file</code>; otherwise, it will overwrite the contents of <code>file</code>.</p> </td></tr> <tr valign="top"><td><code>control</code></td> <td> <p>character vector indicating deparsing options. See <code><a href="deparseOpts.html">.deparseOpts</a></code> for their description.</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>the environment to search for objects.</p> </td></tr> <tr valign="top"><td><code>evaluate</code></td> <td> <p>logical. Should promises be evaluated?</p> </td></tr> </table> <h3>Details</h3> <p>If some of the objects named do not exist (in scope), they are omitted, with a warning. If <code>file</code> is a file and no objects exist then no file is created. </p> <p><code>source</code>ing may not produce an identical copy of <code>dump</code>ed objects. A warning is issued if it is likely that problems will arise, for example when dumping exotic or complex objects (see the Note). </p> <p><code>dump</code> will also warn if fewer characters were written to a file than expected, which may indicate a full or corrupt file system. </p> <p>A <code>dump</code> file can be <code><a href="source.html">source</a></code>d into another <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> (or perhaps S) session, but the function <code><a href="save.html">save</a></code> is designed to be used for transporting <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> data, and will work with <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects that <code>dump</code> does not handle. For maximal reproducibility use <code>control = c("all", "hexNumeric")</code>. </p> <p>To produce a more readable representation of an object, use <code>control = NULL</code>. This will skip attributes, and will make other simplifications that make <code>source</code> less likely to produce an identical copy. See <code><a href="deparse.html">deparse</a></code> for details. </p> <p>To deparse the internal representation of a function rather than displaying the saved source, use <code>control = c("keepInteger", "warnIncomplete", "keepNA")</code>. This will lose all formatting and comments, but may be useful in those cases where the saved source is no longer correct. </p> <p>Promises will normally only be encountered by users as a result of lazy-loading (when the default <code>evaluate = TRUE</code> is essential) and after the use of <code><a href="delayedAssign.html">delayedAssign</a></code>, when <code>evaluate = FALSE</code> might be intended. </p> <h3>Value</h3> <p>An invisible character vector containing the names of the objects which were dumped. </p> <h3>Note</h3> <p>As <code>dump</code> is defined in the base namespace, the <span class="pkg">base</span> package will be searched <em>before</em> the global environment unless <code>dump</code> is called from the top level prompt or the <code>envir</code> argument is given explicitly. </p> <p>To avoid the risk of a source attribute becoming out of sync with the actual function definition, the source attribute of a function will never be dumped as an attribute. </p> <p>Currently environments, external pointers, weak references and objects of type <code>S4</code> are not deparsed in a way that can be <code>source</code>d. In addition, <a href="is.language.html">language objects</a> are deparsed in a simple way whatever the value of <code>control</code>, and this includes not dumping their attributes (which will result in a warning). </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="dput.html">dput</a></code>, <code><a href="dput.html">dget</a></code>, <code><a href="write.html">write</a></code>.<br /> <code><a href="save.html">save</a></code> for a more reliable way to save <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects. </p> <h3>Examples</h3> <pre> x <- 1; y <- 1:10 fil <- tempfile(fileext=".Rdmped") dump(ls(pattern = '^[xyz]'), fil) print(.Last.value) unlink(fil) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>