overture (version 0.4-0)

ToMemory: Converts matrices in a file-backed MCMC to R matrix objects

Description

ToMemory is a convenience method to load the samples from a file-backed MCMC run into memory. Given a list of big.matrix objects, it will convert them to standard R matrix objects.

Usage

ToMemory(samples)

Arguments

samples

list of big.matrix objects, typically coming from InitMcmc

Value

list of R matrix objects

See Also

InitMcmc, big.matrix

Examples

Run this code
# NOT RUN {
# Run a file-backed MCMC
backing.path <- tempfile()
dir.create(backing.path)
Mcmc <- InitMcmc(1000, backing.path=backing.path)
samples <- Mcmc({
    x <- rnorm(1)
    y <- rnorm(2)
})

# Convert to standard in-memory R matrices
samples.in.memory <- ToMemory(samples)

is.matrix(samples.in.memory$x)
is.matrix(samples.in.memory$y)
bigmemory::is.big.matrix(samples.in.memory$x)
bigmemory::is.big.matrix(samples.in.memory$y)
# }

Run the code above in your browser using DataCamp Workspace