View source: R/S3_standalone.R
| hdf5_remove | R Documentation |
Deletes a dataset from an HDF5 file, given the file path and the full
internal dataset path ("group/name"). No open HDF5Matrix
object is required. If you already have an open HDF5Matrix, you can
equivalently call its $remove() method.
hdf5_remove(filename, dataset)
filename |
Path to the HDF5 file. |
dataset |
Full internal path of the dataset to remove, in the form
|
Space is not reclaimed. HDF5 only unlinks the dataset: the
link is removed so the dataset can no longer be opened, but the disk space
it occupied is not returned to the operating system until the file
is rewritten. To physically reclaim the space, repack the file with the
HDF5 command-line tool, e.g. h5repack old.h5 new.h5, or copy the
datasets you want to keep into a fresh file. Consequently, repeatedly
creating and removing datasets in the same file can make it grow on disk
even though the logical contents shrink.
Removing a dataset that does not exist raises an error.
TRUE invisibly on success.
hdf5_matrix, hdf5_create_matrix,
list_datasets
fn <- tempfile(fileext = ".h5")
hdf5_create_matrix(fn, "grp/keep", data = matrix(1:6, 2, 3))
hdf5_create_matrix(fn, "grp/tmp", data = matrix(1:6, 2, 3))
hdf5_remove(fn, "grp/tmp")
list_datasets(fn, group = "grp") # only "keep" remains
hdf5_close_all()
unlink(fn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.