[datatable-help] A vote for := with by

Sebastian Kranz skranz at uni-bonn.de
Tue Apr 3 14:28:41 CEST 2012


Dear Matthew,

data.table is a great package! Following your suggestion, 
I just wanted to let you know that it would be really 
great if := would work with by.

  I have no clue how hard it is to implemented it 
efficiently. If an efficient implementation is likely to 
take some time, perhaps one could already implement a 
simple workaround, like autmatically calling:

dt[,transform(.SD, newcol = expr),by=by.col]

when the user supplied

dt[,newcol := expr, by=by.col]

This would already allow to use the simpler syntax. (I 
wanted to teach some students new to R how data.table 
allows convenient and quick data aggregation and would 
find it much easier to explain the second syntax instead 
of explaining the first syntax)

Anyway, thanks to all developers for creating and 
maintaining the package!

Best wishes,
Sebastian


More information about the datatable-help mailing list