Learn R Programming

rstan (version 2.8.2)

read_rdump: Read data in an Rdump file to a list

Description

Create an Rlist from an Rdump file

Usage

read_rdump(f)

Arguments

f
A character string providing the dump file name.

Value

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

Details

The Rdump file can be read directly by Rfunction 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.

See Also

stan_rdump; dump

Examples

Run this code
x <- 1; y <- 1:10; z <- array(1:10, dim = c(2,5)) 
stan_rdump(ls(pattern = '^[xyz]'), "xyz.Rdump")
l <- read_rdump('xyz.Rdump')
print(l)

Run the code above in your browser using DataLab