[datatable-help] Ordering of filter expressions

Johann Hibschman jhibschman at gmail.com
Fri Dec 12 16:23:48 CET 2014


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

P.S. data.table is 1.9.4, R is 3.1.2.


More information about the datatable-help mailing list