[datatable-help] "by" on integer64 not working

Matthew Dowle mdowle at mdowle.plus.com
Sat Sep 14 22:06:16 CEST 2013


Sorry - haven't got to implementing grouping or keys for integer64 yet. 
All that's been done is integer64 in fread. There's a bug item on the list.

Matthew

On 14/09/13 20:05, Harish wrote:
> 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
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130914/c640e50b/attachment-0001.html>


More information about the datatable-help mailing list