<div dir="ltr">I can't reproduce this in 1.9.5 (current devel): <a href="http://github.com/Rdatatable/data.table">http://github.com/Rdatatable/data.table</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 15, 2014 at 3:26 PM, Johann Hibschman <span dir="ltr"><<a href="mailto:jhibschman@gmail.com" target="_blank">jhibschman@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I finally had time to put together a minimal example:<br>
<br>
> d <- data.table(a=1:2, b=1:2)<br>
> d[round(a) == a]<br>
a b<br>
1: 1 1<br>
2: 2 2<br>
> d[a == round(a)]<br>
Error in eval(expr, envir, enclos) : object 'a' not found<br>
<br>
Is this a bug, or am I missing something about the scoping rules?<br>
<br>
R 3.1.2, data.table 1.9.4, on Windows 7.<br>
<br>
Thanks,<br>
Johann<br>
<span class="im HOEnZb"><br>
On Fri, Dec 12, 2014 at 10:18 AM, Johann Hibschman <<a href="mailto:jhibschman@gmail.com">jhibschman@gmail.com</a>> wrote:<br>
> I just ran into an issue where d[X==round(X)] gives different results<br>
> from d[round(X) == X]. Why would that happen?<br>
><br>
> Here's the exact example:<br>
><br>
>> z.dev[YIELD == round(YIELD),]<br>
> Error in eval(expr, envir, enclos) : object 'YIELD' not found<br>
>> z.dev[round(YIELD) == YIELD,]<br>
> runId dealName cusip scenarioId shockId pathOrder PRICE100<br>
> YIELD MOD_DURN MOD_CONVEXITY DISC_MARGIN SPREAD_BP<br>
> 1: 10556 HVML0501 41161PLE1 772 0 3 54.5094<br>
> 6 4.739 0.431 400 418<br>
> 2: 10556 HVML0501 41161PLE1 773 0 3 52.9452<br>
> 6 4.706 0.427 400 424<br>
><br>
> Thanks,<br>
> Johann<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br>
</div></div></blockquote></div></div>