[datatable-help] Ordering of filter expressions

Arunkumar Srinivasan aragorn168b at gmail.com
Mon Dec 15 15:53:42 CET 2014


I can't reproduce this in 1.9.5 (current devel):
http://github.com/Rdatatable/data.table

On Mon, Dec 15, 2014 at 3:26 PM, Johann Hibschman <jhibschman at gmail.com>
wrote:
>
> I finally had time to put together a minimal example:
>
>     > d <- data.table(a=1:2, b=1:2)
>     > d[round(a) == a]
>        a b
>     1: 1 1
>     2: 2 2
>     > d[a == round(a)]
>     Error in eval(expr, envir, enclos) : object 'a' not found
>
> Is this a bug, or am I missing something about the scoping rules?
>
> R 3.1.2, data.table 1.9.4, on Windows 7.
>
> Thanks,
> Johann
>
> On Fri, Dec 12, 2014 at 10:18 AM, Johann Hibschman <jhibschman at gmail.com>
> wrote:
> > I just ran into an issue where d[X==round(X)] gives different results
> > from d[round(X) == X]. Why would that happen?
> >
> > Here's the exact example:
> >
> >> z.dev[YIELD == round(YIELD),]
> > Error in eval(expr, envir, enclos) : object 'YIELD' not found
> >> z.dev[round(YIELD) == YIELD,]
> >    runId dealName     cusip scenarioId shockId pathOrder PRICE100
> > YIELD MOD_DURN MOD_CONVEXITY DISC_MARGIN SPREAD_BP
> > 1: 10556 HVML0501 41161PLE1        772       0         3  54.5094
> > 6    4.739         0.431         400       418
> > 2: 10556 HVML0501 41161PLE1        773       0         3  52.9452
> > 6    4.706         0.427         400       424
> >
> > Thanks,
> > Johann
> _______________________________________________
> 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/20141215/dc2b25dc/attachment.html>


More information about the datatable-help mailing list