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

Reply via email to