Learn R Programming

raveio (version 0.9.0)

save_h5: Save objects to 'HDF5' file without trivial checks

Description

Save objects to 'HDF5' file without trivial checks

Usage

save_h5(
  x,
  file,
  name,
  chunk = "auto",
  level = 4,
  replace = TRUE,
  new_file = FALSE,
  ctype = NULL,
  quiet = FALSE,
  ...
)

Value

Absolute path of the file saved

Arguments

x

an array, a matrix, or a vector

file

path to 'HDF5' file

name

path/name of the data; for example, "group/data_name"

chunk

chunk size

level

compress level from 0 - no compression to 10 - max compression

replace

should data be replaced if exists

new_file

should removing the file if old one exists

ctype

data type such as "character", "integer", or "numeric". If set to NULL then automatically detect types. Note for complex data please store separately the real and imaginary parts.

quiet

whether to suppress messages, default is false

...

passed to other LazyH5$save

See Also

load_h5

Examples

Run this code

file <- tempfile()
x <- array(1:120, dim = 2:5)

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

# read data
y <- load_h5(file, '/group/dataset/1')
y[]

Run the code above in your browser using DataLab