<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">actually I found the issue. That was not related to data.table but because I'm comparing float values, it breaks all the time if I do not round() my values before. Basically I have values like 0,1, 1.5, 0.5 etc...<br>
</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I know it's bad to do that but I'm not the boss in this project ;-)<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
Just in case other users are reading my email, I can only advise to read that again and again:<br><a href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html" target="_blank">http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html</a><br>
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><font color="#003366"><font face="Verdana, Arial, Helvetica, sans-serif">Best,<br>David</font></font><br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 9, 2013 at 11:39 AM, Matthew Dowle <span dir="ltr"><<a href="mailto:mdowle@mdowle.plus.com" target="_blank">mdowle@mdowle.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div>
<p> </p>
<p>That's odd. Please provide result of sessionInfo() and str(DT).</p><span><font color="#888888">
<p>Matthew</p></font></span><div><div>
<p> </p>
<p>On 09.04.2013 11:32, David Bellot wrote:</p>
<blockquote type="cite" style="padding-left:5px;border-left:#1010ff 2px solid;margin-left:5px;width:100%">
<div dir="ltr">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi,<br><br></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.<br>
<br></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Later on, I aggregate my DT with x like this:<br>agg = DT[ , list(m=mean(y), c=length(y)), by = c("x") ]<br><br></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br>I'm sure I'm missing something totally obvious :-( !!!!<br><br></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Any idea ?</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Best,<br>David</div>
</div>
</blockquote>
<p> </p>
<div> </div>
</div></div></div>
</blockquote></div><br></div></div>