provides hybrid data structure for 'HDF5' file
whether to suppress messages
garbage collection method
overrides print method
LazyH5$new(file_path, data_name, read_only = FALSE, quiet = FALSE)
where data is stored in 'HDF5' format
the data stored in the file
whether to open the file in read-only mode. It's highly recommended to set this to be true, otherwise the file connection is exclusive.
whether to suppress messages, default is false
save data to a 'HDF5' file
LazyH5$save( x, chunk = "auto", level = 7, replace = TRUE, new_file = FALSE, force = TRUE, ctype = NULL, size = NULL, ... )
vector, matrix, or array
chunk size, length should matches with data dimension
compress level, from 1 to 9
if the data exists in the file, replace the file or not
remove the whole file if exists before writing?
if you open the file in read-only mode, then saving
objects to the file will raise error. Use
force=TRUE to force
data type, see
mode, usually the data type
storage.mode(x) as hints.
deprecated, for compatibility issues
passed to self
LazyH5$open(new_dataset = FALSE, robj, ...)
only used when the internal pointer is closed, or to write the data
data array to save
LazyH5$close(all = TRUE)
whether to close all connections associated to the data file. If true, then all connections, including access from other programs, will be closed
LazyH5$subset(..., drop = FALSE, stream = FALSE, envir = parent.frame())
whether to apply
drop the subset
whether to read partial data at a time
i,j,... are expressions, where should the
expression be evaluated
i, j, ...
index along each dimension
subset of data
get data dimension
LazyH5$get_dims(stay_open = TRUE)
whether to leave the connection opened
dimension of the array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Data to save x <- array(rnorm(1000), c(10,10,10)) # Save to local disk f <- tempfile() save_h5(x, file = f, name = 'x', chunk = c(10,10,10), level = 0) # Load via LazyFST dat <- LazyH5$new(file_path = f, data_name = 'x', read_only = TRUE) dat # Check whether the data is identical range(dat - x) # Read a slice of the data system.time(dat[,10,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.