## ----filter-pipeline, echo = FALSE, fig.cap="The default compression pipeline used by rhdf5"---- knitr::include_graphics("filter_pipeline.png") ## ---- plugin-path, eval = TRUE------------------------------------------------ rhdf5filters::hdf5_plugin_path() ## ---- check-h5dump, echo = FALSE, include = FALSE----------------------------- ## error code 127 indicate the command could not be run h5dump_found <- (system2('h5dump') != 127) ## ---- warning = FALSE, eval = h5dump_found------------------------------------ # ## blosc compressed file # blosc_file <- system.file("h5examples/h5ex_d_blosc.h5", # package = "rhdf5filters") # ## unset environment variable # Sys.setenv("HDF5_PLUGIN_PATH" = "") ## ---- h5dump-1, warning = FALSE, eval = h5dump_found-------------------------- # h5dump_out <- system2('h5dump', # args = c('-p', '-d /dset', blosc_file), # stdout = TRUE, stderr = TRUE) # cat(h5dump_out, sep = "\n") ## ----h5dump-2, eval = h5dump_found-------------------------------------------- # ## set environment variable to hdf5filter location # Sys.setenv("HDF5_PLUGIN_PATH" = rhdf5filters::hdf5_plugin_path()) # h5dump_out <- system2('h5dump', # args = c('-p', '-d /dset', '-w 50', blosc_file), # stdout = TRUE, stderr = TRUE) # # ## find the data entry and print the first few lines # DATA_line <- grep(h5dump_out, pattern = "DATA \\{") # cat( h5dump_out[ (DATA_line):(DATA_line+2) ], sep = "\n" ) ## ----sessionInfo, echo=FALSE-------------------------------------------------- sessionInfo()