[datatable-help] Idiomatic way of using expression in i

G See gsee000 at gmail.com
Tue Aug 18 15:07:35 CEST 2015


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 <statquant at outlook.com> 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
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help


More information about the datatable-help mailing list