Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgmedian failing on simple case #2046
Comments
|
I'm running 1.10.4 on R 3.2.5 and don't see that error. To see if gmedian is being used, Fyi, they prefer that you test on the devel version, currently 1.10.5 https://github.com/Rdatatable/data.table/wiki/Support |
|
Sorry, yes I should have updated to the latest version. Updated to 1.10.5, still happens. But it is weird. I start with R --vanilla. sessionInfo() yields:
When I start it up, I paste in this exact block:
Approximately 3/4s of the time I do this, I get the error mentioned above. The other 1/4 of the times I try it works for me. I have ran other code that uncovered this issue for me in the first place on networked machines and it produced the same errors, so I don't think this is some weird memory corruption thing. Thoughts? |
|
What appears to be happening is that in [.data.table, if 'on' is missing, then it gets set to integer(0), which eventually gets passed down as the 'o' parameter to the C implementation of gforce. In there we have: While I've been able to track this down, I don't understand the code well enough to fix it. Can someone work out a patch for it? |
|
Linking this |
On 1.10.4:
Yields the following error:
Error in gmedian(y) : negative length vectors are not allowed
If dt doesn't have a key set, it doesn't throw the error (but I can't tell if gmedian is even being called in that case). Also calling stats::median instead of median above works because it bypasses gmedian directly.