[datatable-help] integer64 group by doesn't find all groups

Matt Dowle mdowle at mdowle.plus.com
Wed Feb 12 17:22:26 CET 2014


Hi,

You're doing nothing wrong.  Although you can load integer64 using fread 
and create them directly,  data.table's grouping and keys don't work on 
them yet.  Sorry,  just not yet implemented. Because integer64 are 
internally stored as type double  (a good idea by package bit64),  
data.table sees them internally as double and doesn't catch that the 
type isn't supported yet (hence no error message such as you get for 
type 'complex').   The particular integer64 numbers in this example are 
quite small so will use the lower bits.  In double, those are the most 
precise part of the significand, which would explain why only one group 
comes out here since data.table groups and joins floating point data 
within tolerance.

Matt

On 06/02/14 23:38, Yike Lu wrote:
> After a long hiatus, I am back to using data.table. Unfortunately, 
> I've encountered a problem. Am I doing something wrong here?
>
> require(data.table)
>
> dt = data.table(idx = 1:100 %% 3, 1:100)
> dt[, list(sum(V2)), by = idx]
> # normal
>
> require(bit64)
>
> dt2 = data.table(idx = integer64(100) + 1:100 %% 3, 1:100)
> dt2[, list(sum(V2)), by = idx]
> # only has one group:
> #   idx   V1
> #1:   1 5050
>



More information about the datatable-help mailing list