I would do it like this (per FAQ 1.6)

dt <- data.table(x=rnorm(1000),y=rnorm(1000))
iExpr <- quote(x>1 & y<.045)
dt[eval(iExpr)]



On Tue, Aug 18, 2015 at 7:57 AM, statquant3 <[email protected]> wrote:
> DT[eval(parse(text=iExpr))] is working, but it is the "correct" way
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Idiomatic-way-of-using-expression-in-i-tp4711229p4711230.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> [email protected]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to