My aggregation needs vary among columns / data.frames. I would like to pass the \"list\" argument to the data.table dynamically.
As a minimal example:
Another method (supporting the use of paste or paste0 to build the expression):
paste
paste0
expr <- parse(text=mylist) DT[, eval( expr ), by=type] #------- type lengtha maxb meanc 1: hello 3 0.8265407 0.5244094 2: bye 3 0.4955301 0.6289475 3: ok 3 0.9527455 0.5600915