Learn R Programming

bigmemory (version 3.6)

deepcopy: Produces a physical copy of a ``big.matrix''

Description

This is needed to make a duplicate of a big.matrix; currently, it creates a non-shared big.matrix regardless of the nature of the argument, and this will be changed to support additional options.

Usage

deepcopy(x, type = NULL, separated = NULL, shared = NULL, backingfile = NULL,
         backingpath = NULL, preserve = TRUE)

Arguments

type
preferably specified, "integer" for example.
separated
use separated column organization of the data instead of column-major organization.
shared
if TRUE, load the object into shared memory.
backingfile
the root name for the file(s) for the cache of x.
backingpath
the path to the directory containing the file backing cache.
preserve
if this is a filebacked big.matrix, it is preserved, by default, even after the end of the R session unless this option is set to FALSE.

Value

Details

This is needed to make a duplicate of a big.matrix, because traditional R syntax would only copy the R object (the pointer to the big.matrix rather than the big.matrix itself). This function needs to be revised to support shared and file-backed objects. Not a big deal, and definitely on our todo list.

See Also

big.matrix

Examples

Run this code
x <- as.big.matrix(matrix(1:30, 10, 3))
y <- deepcopy(x)
x
y
head(x)
head(y)

Run the code above in your browser using DataLab