This function takes a vector of names of R objects and produces text representations of the objects on a file or connection. A dump file can usually be sourced into another R session.
dump(list, file = "dumpdata.R", append = FALSE,
control = "all", envir = parent.frame(), evaluate = TRUE)
| Parameter | Description |
|---|---|
list |
character vector. The names of one or more R objects to be dumped. |
file |
either a character string naming a file or a connection. "" indicates output to the console. |
append |
if TRUE and file is a character string, output will be appended to file; otherwise, it will overwrite the contents of file. |
control |
character vector indicating deparsing options. See .deparseOpts for their description. |
envir |
the environment to search for objects. |
evaluate |
logical. Should promises be evaluated? |
# NOT RUN {
x <- 1; y <- 1:10
fil <- tempfile(fileext=".Rdmped")
dump(ls(pattern = '^[xyz]'), fil)
print(.Last.value)
unlink(fil)
# }