Skip to content
Prev 35356 / 63424 Next

split.data.frame

This seems very similar to the data.table package.

The 'by' argument splits the data.table by that value then executes the j 
expression within each subset.  The package documentation talks about 
'subset' and 'with' in some detail. See ?"[.data.table".

dt = data.table(x=1:20, y=rep(1:4,each=5)
dt[,sum(x),by="y"]
In data.table that choice is given to the user via the argument 'with' which 
by default is TRUE meaning you get the x inside dt.


"Romain Francois" <romain.francois at dbmail.com> wrote in message 
news:4B288645.3010602 at dbmail.com...