[R] Bug in by() with dates as levels?

Dieter Menne dieter.menne at menne-biomed.de
Thu Mar 5 10:14:53 CET 2009


hadley wickham <h.wickham <at> gmail.com> writes:

> 
> You might also want to take a look at the plyr package:
> 
> install.packages("plyr")
> library(plyr)
> ddply(x, .(A, D), function(df) sum(df$Z))
> dlply(x, .(A, D), function(df) sum(df$Z))
> 

I recently for the first time used the plyr package in an introductory 
course as a general replacement of for "by", "(x)apply", followed by 
do.call gymnastics. It was an amazing step forward to have a nicely 
orthogonal set of function that returns what people expected instead 
of converting everything to a list.

I know, real MEN program assembler and love (x)apply...


Dieter




More information about the R-help mailing list