Entering edit mode
Laurent Gautier
★
2.3k
@laurent-gautier-29
Last seen 10.3 years ago
Dear all,
I observed unexplainable things with rhdf5. I do not
know if they could be avoided.
I am trying to access datasets in a group using the
function 'do.call' with "$" (since the name of the
dataset will only be known at run-time)... and I have
a hard time with that (example below). Does anybody
have experience with that ?
## example from the help file
> mad <- hdf5.open("microarray.h5")
> # Create a new group inside the file
> hdf5.group(mad,"chip1")
> hdf5.dataset(mad$chip1,"raw", dim=c(534,534))
>
> raw <- mad$chip1$raw
> for(i in 1:534)
+ { raw[i,1:534] <- runif(534) }
>
> do.call("$", list("mad", "chip1"))
NULL
# uh, uh....
> mad$chip1
Name Type Date Comment
[1] raw Dataset 21/07/2002 16:26
# let's try again...
> do.call("$", list("mad", "chip1"))
NULL
> mad
Name Type Date Comment
[1] chip1 Group
# show stopper
> mad[[1]]
Segmentation fault
Thanks,
Laurent
--
--------------------------------------------------------------
Laurent Gautier CBS, Building 208, DTU
PhD. Student DK-2800 Lyngby,Denmark
tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent