Since the standard R package to manage HDF5 format has changed to rhdf5
, some features are no longer available. One of those is hdf5load
:
h5pointer = hdf5load(file=h5file,load=FALSE,verbosity=0,tidy=TRUE)
variable = h5pointer$element
where h5file
is the HDF5
file to read in. One could solve the problem this way:
variable = h5read (h5file, "element")
The problem is that I have a huge number of those lines so this would mean to change a lot of code lines.
Is there a way to have an object like h5pointer
from which I can later dereference the elements of?
Sorry for copy pasting from http://stackoverflow.com/questions/35095937/new-equivalent-of-hdf5load but it's the very same question to which I could not find answer so far.
Thanks for your attention.
Since I am using R installed via macports I couldn't test the solution sooner (the R3.3.0 came out in the last days). It works so thank you very much for saving me a lot of time Bernd.
Just a side thing; I am actually opening/reading the hdf files inside a for loop. I noticed that the last one to be opened/read take much longer than the first ones. I was thinking that it might be due to the fact that there are more and more opened files. However with the previous hdf5 packet this was not a problem and I used to close everything at the end.
Do you think I should modify the procedure?
Thank you again
You can use
H5close()
orH5Fclose(h5file)
to close the file in between. Checkh5listIdentifier()
for a list of all open HDF5 handles. Close them, once you don't need them anymore.