Open mschubert opened 4 years ago
Hi, I've just experienced the same bug.
The cause seems to be line 17 in h5read.R
using eval()
: for whatever reason, this is called in a different environment to the function, so it won't find the variables. Setting them in the global environment will work, but is obviously not the desired behaviour, since global vars will shadow function arguments.
I don't know if the best solution would be to capture the calling environment, eval
the index in a different place, or use a less magical solution. For now you can work around this using un-exported functions (note the triple colon :::
) from the package like so:
rhdf5:::h5readDataset(my_dataset, start=a, count=N)
This is with the current git
master
.Consider the following example file (borrowed from the open PR):
Subsetting this file works fine if I use:
However, if I wrap the loading in a function it fails: