View source: R/HDF5Matrix_constructor.R
| hdf5_matrix | R Documentation |
Opens an existing dataset in an HDF5 file and returns an HDF5Matrix
object that can be used with standard R syntax: dim(), [i,j],
%*%, crossprod(), and tcrossprod().
hdf5_matrix(filename, path)
filename |
Path to an existing HDF5 file |
path |
Full path to the dataset within the file, in the form
|
The HDF5 file remains open while the object exists, which improves
performance for repeated operations. Call $close() to release
the file lock explicitly, or use rm() and gc() for
automatic cleanup. In an emergency, hdf5_close_all closes
all open HDF5Matrix objects.
An HDF5Matrix object
hdf5_close_all, [.HDF5Matrix,
crossprod.HDF5Matrix, tcrossprod.HDF5Matrix
tmp <- tempfile(fileext = ".h5")
# Create dataset using BigDataStatMeth API
X <- hdf5_create_matrix(tmp, "data/expression",
data = matrix(rnorm(200), 20, 10))
dim(X) # 20 x 10
X[1:5, 1:3] # subset
crossprod(X) # t(X) %*% X
close(X)
unlink(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.