[R] SUM,COUNT,AVG

hadley wickham h.wickham at gmail.com
Tue Apr 7 05:13:48 CEST 2009


On Mon, Apr 6, 2009 at 5:31 PM, Jun Shen <jun.shen.ut at gmail.com> wrote:
> This is a good example to compare different approaches. My understanding is
>
> aggregate() can apply one function to multiple columns
> summarize() can apply multiple functions to one column
> I am not sure if ddply() can actually apply multiple functions to multiple
> columns? This is what I would like to do. The syntax in the help is  a
> little confusing to me. Appreciate more comments. Thanks

In theory, you should be able to combine colwise and each:
colwise(each(min, median, max)).   That should return the min, median
and max for each column, but currently it doesn't return the values in
quite right the form for recombination with ddply.

Hadley

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




More information about the R-help mailing list