<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">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:<br><br>library( data.table )<br>library( bit64 )<br><br>DT <- data.table( a=rep( 1:5, 2), b=15:24 )<br>DT[ , .N, by=a ]<br>DT[ , a := as.integer64( a ) ]<br>DT[ , .N, by=a ]<br><br>The output I get is:<br><br><div>> DT <- data.table( a=rep( 1:5, 2), b=15:24 )<br>> DT[ , .N, by=a ]<br> a N<br>1: 1 2<br>2: 2 2<br>3: 3 2<br>4: 4 2<br>5: 5 2<br>> DT[ , a := as.integer64( a ) ]<br>> DT[ , .N, by=a ]<br> a N<br>1: 1 10</div><div><br></div><div>Notice that the "by" after converting column "a" to integer64 is different from before. However, the values of "a" are correct:<br></div><div>> DT$a<br>integer64<br> [1] 1 2 3 4 5 1 2 3 4
5</div><div><br></div><div>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.<br></div><div><br></div><div>Am I doing something wrong or is this a bug? Thanks for your help.<br></div><div><br></div><div><br></div><div>Regards,</div><div>Harish</div><div></div></div></body></html>