On Wed, Jan 20, 2010 at 8:43 AM, Matthew Dowle <mdo...@mdowle.plus.com> wrote:
> Sounds like a good idea. Would it be possible to give an example of how to
> combine plyr with data.table, and why that is better than a data.table only
> solution ?

Well, ideally, you'd do:

adt <- data.table(a)
ans2 <- ddply(a, c("var1", "var2", "var3"), subset, dt - min(dt) < 7)

and ddply would take care of the details.

Why would it be better?  Because plyr works for all data types: data
frames, lists and arrays.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to