我是 hdf5 文件的新手。尝试从以下 URL 读取一些示例文件.. https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/
尝试在 R 环境中读取 .h5 文件之一时
库(rhdf5)
h5ls("h5ex_d_sofloat.h5")
我收到以下错误
Error in H5Fopen(file, "H5F_ACC_RDONLY") : HDF5. File accessability. Unable to open file.
感谢帮助。
最佳答案
Windows 本身存在一些问题,它在使用默认参数下载 hdf5 文件时对其进行加密。下载时只需将模式更改为“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
我从bioconductor本身得到了这个解决方案...... https://support.bioconductor.org/p/97311/#97362
关于R:使用 rdhf5 包从 R 读取 .h5 文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44695024/