read_rdump | R Documentation |
Create an R list from an R dump file
read_rdump(f, keep.source = FALSE, ...)
f |
A character string providing the dump file name. |
keep.source |
logical: should the source formatting be retained when echoing expressions, if possible? |
... |
passed to |
The R dump file can be read directly by R function source
, which
by default would read the data into the user's workspace (the global environment).
This function instead read the data to a list, making it convenient to
prepare data for the stan
model-fitting function.
A list containing all the data defined in the dump file with keys corresponding to variable names.
stan_rdump
; dump
x <- 1; y <- 1:10; z <- array(1:10, dim = c(2,5))
stan_rdump(ls(pattern = '^[xyz]'), file.path(tempdir(), "xyz.Rdump"))
l <- read_rdump(file.path(tempdir(), 'xyz.Rdump'))
print(l)
unlink(file.path(tempdir(), "xyz.Rdump"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.