Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read_rdump

Read data in an R dump file to a list


Description

Create an R list from an R dump file

Usage

read_rdump(f, keep.source = FALSE, ...)

Arguments

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 source

Details

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.

Value

A list containing all the data defined in the dump file with keys corresponding to variable names.

See Also

Examples

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"))

rstan

R Interface to Stan

v2.21.2
GPL (>= 3)
Authors
Jiqiang Guo [aut], Jonah Gabry [aut], Ben Goodrich [cre, aut], Sebastian Weber [aut], Daniel Lee [ctb], Krzysztof Sakrejda [ctb], Modrak Martin [ctb], Trustees of Columbia University [cph], Oleg Sklyar [cph] (R/cxxfunplus.R), The R Core Team [cph] (R/pairs.R, R/dynGet.R), Jens Oehlschlaegel-Akiyoshi [cph] (R/pairs.R), John Maddock [cph] (gamma.hpp), Paul Bristow [cph] (gamma.hpp), Nikhar Agrawal [cph] (gamma.hpp), Christopher Kormanyos [cph] (gamma.hpp), Bronder Steve [ctb]
Initial release
2020-07-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.