file <- tempfile()
x <- array(1:120, dim = c(4,5,6))
# save x to file with name /group/dataset/1
io_write_h5(x, file, '/group/dataset/1', quiet = TRUE)
# read data
y <- io_read_h5(file, '/group/dataset/1', ram = TRUE)
class(y) # array
z <- io_read_h5(file, '/group/dataset/1', ram = FALSE)
class(z) # LazyH5
dim(z)
# clean up
unlink(file)
Run the code above in your browser using DataLab