View source: R/hdf5-functions.R
h5Overwrite | R Documentation |
Overwrite an existing HDF5 link
h5Overwrite(
file,
name,
overwrite,
verbose = getOption(x = "h5.overwrite.verbose", default = FALSE)
)
file |
An existing HDF5 file |
name |
Name of HDF5 link to be overwritten. |
overwrite |
Whether or not to overwrite |
verbose |
Print progress. |
When file
doesn't exist, will create it.
When the old link name
doesn't exist, will simply return
file
.
When name
exists and overwrite
is TRUE
, will copy
the rest of HDF5 links to an updated file
with h5Backup
.
If name
is "/", will create a new file
and overwrite the old one.
When name
exists and overwrite
is FALSE
, will
raise an error.
Path to file
which is ready to be written.
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)
h5Exists(tmp.file, "layers")
# You can still read other links.
obs2 <- h5Read(tmp.file, "obs")
identical(obs, obs2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.