[R] problem of data manipulation
Matthew Dowle
mdowle at mdowle.plus.com
Wed Jan 20 17:58:01 CET 2010
I see now, thanks for explaining that. Would it be for you to add data.table
methods to ddply then, for this to happen? Or does a ddply method need to
be added to data.table?
"hadley wickham" <h.wickham at gmail.com> wrote in message
news:f8e6ff051001200825q4009a122m122082a9df5fe56a at mail.gmail.com...
> On Wed, Jan 20, 2010 at 8:43 AM, Matthew Dowle <mdowle at 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/
>
More information about the R-help
mailing list