I am trying to use "by" on integer64 data and data.table seems to think that 
there is only one value.  This is reproduced with the following:

library( data.table )
library( bit64 )

DT <- data.table( a=rep( 1:5, 2), b=15:24 )
DT[ , .N, by=a ]
DT[ , a := as.integer64( a ) ]
DT[ , .N, by=a ]

The output I get is:


> DT <- data.table( a=rep( 1:5, 2), b=15:24 )
> DT[ , .N, by=a ]
   a N
1: 1 2
2: 2 2
3: 3 2
4: 4 2
5: 5 2
> DT[ , a := as.integer64( a ) ]
> DT[ , .N, by=a ]
   a  N
1: 1 10

Notice that the "by" after converting column "a" to integer64 is different from 
before.  However, the values of "a" are correct:

> DT$a
integer64
 [1] 1 2 3 4 5 1 2 3 4 5

I am using the latest version of data.table from r-forge (1.8.11 Rev 965).  I 
also had the same issue with 1.8.10 from CRAN.


Am I doing something wrong or is this a bug?  Thanks for your help.



Regards,
Harish
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to