Harish,
Thats a bug. I added #1026, fixed, +test 182, +NEWS and committed.
Thanks as always for reporting and for the nice reproducible example.
Matthew
On Sat, 2010-08-14 at 01:08 -0700, Harish wrote:
> I am running into an issue using a quote with eval in 'j'. I think I had a
> similar issue with 'by' in the past; maybe it is a similar bug.
>
> Use the following code to reproduce:
> ---------------------
>
> foo <- function( data, fcn ) {
> q <- substitute( fcn )
>
> # The following line works
> #data[ , eval( q ), by=a ]
>
> # The following line causes an error
> data[ , eval( substitute( fcn ) ), by=a ]
> }
>
> num <- 10
> DT <- data.table( a=rep(c("A","B"),num), b=1:(num*2) )
> foo( DT, sum(b) )
>
> ---------------------
>
> Notice the two lines inside foo(). They should be logically equivalent, but
> only one works.
>
> Is this a bug?
>
>
> Harish
>
>
>
>
> _______________________________________________
> 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