[datatable-help] Error in row filtering

Harish harishv_99 at yahoo.com
Tue Oct 14 14:13:54 CEST 2014


I have a very strange row-filtering issue in front of me that I can only reproduce on a very large data set.  Let me start off by giving you the end symptoms and then I will talk through some  hacks which will avoid the bug.

I have two fields of interest -- pred_bad_t_f and weight.- pred_bad_t_f is of class "integer" with two unique values, 0 and 1- weight is of class "numeric"
> dt[pred_bad_t_f == 1, sum(weight)]
[1] 6580818130
> dt[pred_bad_t_f == 1L, sum(weight)]
[1] 5414941720
As you can see, there is no reason for the second value to be any different.  I believe the first value is correct because slight changes to the filtering logic generates that value repeatedly.  Below are some examples:

> dt[1:nrow( dt)][pred_bad_t_f == 1L, sum(weight)]
[1] 6580818130> dt[TRUE & pred_bad_t_f == 1L, sum(weight)]
[1] 6580818130
s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20141014/6d0d6157/attachment.html>


More information about the datatable-help mailing list