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 to.name already exists, whether or not to overwrite it.

verbose

Print progress.

...

Arguments passed to H5File$link_move_from()

Value

This is an operation function and no return. Any failure should raise an error.

See Also

H5File

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]