load_h5: Lazy Load 'HDF5' File via 'hdf5r-package'

View source: R/hdf5r.R

load_h5R Documentation

Lazy Load 'HDF5' File via hdf5r-package

Description

Wrapper for class LazyH5, which load data with "lazy" mode - only read part of dataset when needed.

Usage

load_h5(file, name, read_only = TRUE, ram = FALSE, quiet = FALSE)

Arguments

file

'HDF5' file

name

group/data_name path to dataset (H5D data)

read_only

only used if ram=FALSE, whether the returned LazyH5 instance should be read only

ram

load data to memory immediately, default is false

quiet

whether to suppress messages

Value

If ram is true, then return data as arrays, otherwise return a LazyH5 instance.

See Also

save_h5

Examples

file <- tempfile()
x <- array(1:120, dim = c(4,5,6))

# save x to file with name /group/dataset/1
save_h5(x, file, '/group/dataset/1', quiet = TRUE)

# read data
y <- load_h5(file, '/group/dataset/1', ram = TRUE)
class(y)   # array

z <- load_h5(file, '/group/dataset/1', ram = FALSE)
class(z)   # LazyH5

dim(z)


raveio documentation built on July 26, 2023, 5:29 p.m.