h5Overwrite {hdf5r.Extra} | R Documentation |
Overwrite an existing HDF5 link
Description
Overwrite an existing HDF5 link
Usage
h5Overwrite(file, name, overwrite)
Arguments
file |
An existing HDF5 file |
name |
Name of HDF5 link to be overwritten. |
overwrite |
Whether or not to overwrite |
Details
When
file
doesn't exist, will create it.When the old link
name
doesn't exist, will simply returnfile
.When
name
exists andoverwrite
isTRUE
, will copy the rest of HDF5 links to an updatedfile
withh5Backup
. Ifname
is "/", will create a newfile
and overwrite the old one.When
name
exists andoverwrite
isFALSE
, will raise an error.
Value
Path to file
which is ready to be written.
Examples
file <- system.file("extdata", "pbmc_small.h5ad", package = "hdf5r.Extra")
tmp.file <- tempfile(fileext = ".h5")
file.copy(file, tmp.file)
obs <- h5Read(tmp.file, "obs")
h5Overwrite(tmp.file, "layers", TRUE)
stopifnot(!h5Exists(tmp.file, "layers"))
# You can still read other links.
obs2 <- h5Read(tmp.file, "obs")
stopifnot(identical(obs, obs2))
[Package hdf5r.Extra version 0.0.6 Index]