Does anyone have experience opening hdf files in R (Windows OS)?

前端 未结 2 897
我寻月下人不归
我寻月下人不归 2020-12-19 10:55

I am unable to work with hdf files in R. I believe the R package hdf5 would be what I need to work with these files, but am having difficulty installing it. I g

相关标签:
2条回答
  • 2020-12-19 11:45

    You need to compile the package first. See Rtools for help.

    On the CRAN page of HDF5 you can see from the ReadMe that dependencies are missing on the Windows build machines used by CRAN. Maybe you can compile these dependencies on your own.

    Actually here there is a guide in the package (win_readme.txt):

    hdf5 R package - Windows Read Me:

    To compile and then use the hdf5 library, you need the Windows binary of the hdf5 library available at: http://hdf.ncsa.uiuc.edu. We tested it with the Windows binary version 1.4.3.

    Download the zip package and unzip it somewhere (for instance, in c:\temp; this dir will be called hereunder).

    1) Compilation of the library:

    • Unzip the current source files of the library in \src\hdf5, if it is not already done.

    • Copy hdf5dll.dll from \5-143-win\c\release\dll to \src\hdf5\src

    • Copy \5-143-win\c\release\include to \src\hdf5\src\include (all files in this dir)

    • Now you should compile successfully as usually with Rcmd INSTALL %R_HOME%\src\hdf5

    • You can zip the dir \library\hdf5 for making installable Windows binary package

    2) Installation of the hdf5 library:

    You cannot run function in this package if you do not put the corresponding hdf5dll.dll in your path... WARNING: using a different version of the dll than the one that was used for compilation could crash R!

    0 讨论(0)
  • 2020-12-19 11:47

    The Bioconductor rhdf5 package is available on all platforms and does not have system dependencies.

    source("http://bioconductor.org/biocLite.R")
    biocLite("rhdf5")
    

    and then each session

    library("rhdf5")
    
    0 讨论(0)
提交回复
热议问题