[datatable-help] aggregating data

Matthew Dowle mdowle at mdowle.plus.com
Tue Apr 9 12:39:21 CEST 2013


 

That's odd. Please provide result of sessionInfo() and str(DT).


Matthew 

On 09.04.2013 11:32, David Bellot wrote: 

> Hi,
> 
> I have
a data.table DT with one of the column named x and I other names, let's
say, a1, a2, ... aN. The key of this data.table is made of a1...aN.
> 
>
Later on, I aggregate my DT with x like this:
> agg = DT[ ,
list(m=mean(y), c=length(y)), by = c("x") ]
> 
> The problem is that "x"
has 331 unique values as found by length(unique(DT$x)) but my result
"agg" only has 119 rows. I tried by changing the key to "x" alone but
the problem persists. My DT table has a few millions rows by the way. 
>

> I'm sure I'm missing something totally obvious :-( !!!!
> 
> Any idea
? 
> Best,
> David

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


More information about the datatable-help mailing list