I'm trying to save an array as a HDF5 file using R, but having no luck.
To try and diagnose the problem I ran example(hdf5save)
. This successfully created a HDF5 file that I could read easily with h5dump
.
When I then ran the R code manually, I found that it didn't work. The code I ran was exactly the same as is ran in the example script (except for a change of filename to avoid overwriting). Here is the code:
(m <- cbind(A = 1, diag(4)))
ll <- list(a=1:10, b=letters[1:8]);
l2 <- list(C="c", l=ll); PP <- pi
hdf5save("ex2.hdf", "m","PP","ll","l2")
rm(m,PP,ll,l2) # and reload them:
hdf5load("ex2.hdf",verbosity=3)
m # read from "ex1.hdf"; buglet: dimnames dropped
str(ll)
str(l2)
and here is the error message from h5dump
:
h5dump error: unable to open file "ex2.hdf"
Does anyone have any ideas? I'm completely at a loss.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…