Learn R Programming

houba (version 0.1.0)

as.marray: Conversion of R objects to memory mapped objects

Description

Conversion of R objects to memory mapped objects

Usage

as.marray(x, datatype, filename)

# S4 method for array as.marray(x, datatype, filename)

as.mmatrix(x, datatype, filename)

# S4 method for matrix as.mmatrix(x, datatype, filename)

as.mvector(x, datatype, filename)

# S4 method for numeric as.mvector(x, datatype, filename)

Value

A memmory-mapped object, of class 'mvector', 'mmatrix' or 'marray'

Arguments

x

an r object

datatype

(optional) type of the memory mapped object

filename

(optional) path to file

Details

If 'filename' is a path to an existing file, the function will raise an error. If you need to overwrite a file, unlink it first.

Examples

Run this code
a <- matrix(1:6, 2)
A <- as.mmatrix(a)
B <- as.mmatrix(a, "float")
A
B

Run the code above in your browser using DataLab