View source: R/delarr-writer-hdf5.R
| read_hdf5 | R Documentation |
Simple convenience function to read a matrix from an HDF5 dataset. For
lazy/streaming access, use delarr_hdf5() instead.
read_hdf5(path, dataset)
path |
Path to the HDF5 file. |
dataset |
Name of the dataset to read. |
The matrix stored in the dataset.
if (requireNamespace("hdf5r", quietly = TRUE)) {
# Write and read back
mat <- matrix(1:20, nrow = 4, ncol = 5)
tf <- tempfile(fileext = ".h5")
write_hdf5(mat, tf, "X")
read_hdf5(tf, "X")
# Clean up
unlink(tf)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.