big_copy | R Documentation |
Deep copy of a Filebacked Big Matrix with possible subsetting. This should also work for any matrix-like object.
big_copy(
X,
ind.row = rows_along(X),
ind.col = cols_along(X),
type = typeof(X),
backingfile = tempfile(tmpdir = getOption("FBM.dir")),
block.size = block_size(length(ind.row)),
is_read_only = FALSE
)
X |
Could be any matrix-like object. |
ind.row |
An optional vector of the row indices that are used. If not specified, all rows are used. Don't use negative indices. |
ind.col |
An optional vector of the column indices that are used. If not specified, all columns are used. Don't use negative indices. |
type |
Type of the Filebacked Big Matrix (default is
|
backingfile |
Path to the file storing the FBM data on disk. An extension ".bk" will be automatically added. Default stores in the temporary directory, which you can change using global option "FBM.dir". |
block.size |
Maximum number of columns read at once. Default uses block_size. |
is_read_only |
Whether the FBM is read-only? Default is |
A copy of X
as a new FBM object.
X <- FBM(10, 10, init = 1:100)
X[]
X2 <- big_copy(X, ind.row = 1:5)
X2[]
mat <- matrix(101:200, 10)
X3 <- big_copy(mat, type = "double") # as_FBM() would be faster here
X3[]
X.code <- big_attachExtdata()
class(X.code)
X2.code <- big_copy(X.code)
class(X2.code)
all.equal(X.code[], X2.code[])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.