[datatable-help] select * and getting the full sub data.table/frame
David Bellot
david.bellot at gmail.com
Thu Jan 17 17:19:00 CET 2013
Hi,
I've been looking all around the web without a clear answer to this trivial
problem. I'm sure I'm not looking where I should:
in fact, I want to replace my use of ddply from the plyr package by
data.table. One of my main use is to group a big data.frame by a group of
variable and do something on this sub data.frame:
ddply( my_df, my_grouping_var, function (d) { do something with d } )
----> d is a data.frame again
and it's slow on big data.frame.
However, I don't really understand how to redo the same thing with a
data.table. Basically if "j" in a data.table is equivalent to the select
clause in SQL, then how do I do SELECT * FROM etc...
I want to be able to pass a function like in ddply that will receive not
only a few columns but the full subset that is selected by the "by" clause.
Thanks...
Best,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130117/06f0cdae/attachment.html>
More information about the datatable-help
mailing list