h5Move {hdf5r.Extra} | R Documentation |
Move link in an HDF5 file
Description
Move one HDF5 link to another position within the same file.
Usage
h5Move(file, from.name, to.name, overwrite = FALSE, verbose = TRUE, ...)
Arguments
file |
An HDF5 file. |
from.name |
Name of the source link. |
to.name |
Name of the destination link. |
overwrite |
When |
verbose |
Print progress. |
... |
Arguments passed to |
Value
This is an operation function and no return. Any failure should raise an error.
See Also
Examples
file <- system.file("extdata", "pbmc_small.h5ad", package = "hdf5r.Extra")
to.file <- tempfile(fileext = ".h5")
file.copy(file, to.file)
obs <- h5Read(to.file, "obs")
h5Move(to.file, "obs", "obs2")
obs2 <- h5Read(to.file, "obs2")
stopifnot(identical(obs, obs2))
# Move an object to an existing link
h5Move(to.file, "obs2", "var") # Warning
h5Move(to.file, "obs2", "var", overwrite = TRUE)
# Move a non-existing object will raise an error
try(h5Move(to.file, "obs", "obs3"))
[Package hdf5r.Extra version 0.0.6 Index]