Learn R Programming

houba (version 0.1.0)

restore: Restore memory-mapped matrix

Description

When the external pointer is broken, attempt to recreate a valid object, if the file still exists.

Usage

restore(object)

# S4 method for marray restore(object)

# S4 method for mmatrix restore(object)

# S4 method for mvector restore(object)

Value

a memory-mapped object

Arguments

object

a memory mapped matrix

Examples

Run this code
a <- matrix(1:24, 4, 6)
A <- as.mmatrix(a, "float")
rdsfile <- tempfile(fileext = ".rds")
saveRDS(A, rdsfile)
A <- readRDS(rdsfile)
A
A <- restore(A)
A

Run the code above in your browser using DataLab