R:使用 rdhf5 包从 R 读取 .h5 文件时出错

标签 r rhdf5

我是 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/

相关文章:

R数据表: Shifting rows of list type

r - R中非列表类的继承?

r - 如何使用 knitr 缓存结果来重现给定 block 中的环境?

r - 如何避免打印/显示消息

r - 如何修复 'gcc: error: "/usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a": No such file or directory' in R

r - 无法写入 hdf5 文件 : Error in H5Dcreate

r - ggplot 散点图和线条

r - 使用ggplotly时如何选择要在工具提示中显示的变量?