R: error while reading .h5 files from R using rdhf5 package

1.8k Views Asked by At

I am new to hdf5 files. Trying to read some sample files from the below URL.. https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/

while trying to reading one of the .h5 files in R environment

library(rhdf5) h5ls("h5ex_d_sofloat.h5")

I am getting the below error

Error in H5Fopen(file, "H5F_ACC_RDONLY") : HDF5. File accessability. Unable to open file.

help is appreciated.

1

There are 1 best solutions below

0
himanshu tripathi On BEST ANSWER

There was some issues with windows itself which was encrypting the hdf5 file while downloading it with default arguments. while downloading the just change the mode as "wb"..

file_url <- "http://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/h5ex_d_sofloat.h5"
library(rhdf5)
download.file(url = file_url,destfile = "h5ex_d_sofloat.binary.h5",mode = "wb")
h5ls("h5ex_d_sofloat.binary.h5")


>   group name       otype dclass     dim
0     /  DS1 H5I_DATASET  FLOAT 64 x 32

i got this solution from biocondutor itself... https://support.bioconductor.org/p/97311/#97362