> Try summaryBy in package doBy. e.g. using the built in dataset CO2:
>
> summaryBy(uptake ~ Plant, CO2, FUN = c(mean, min, max))

Or with reshape with a little more work:

cm <- melt(CO2, id=1:4)
cast(cm, Type ~ Treatment, c(min,mean,max))

but you get some extra flexibility:

cast(cm, result_variable + Type ~ Treatment, c(min,mean,max))
cast(cm, Type ~ Treatment ~ result_variable, c(min,mean,max))
cast(cm, Type + Treatment ~ result_variable, c(min,mean,max))

Regards,

Hadley

______________________________________________
[email protected] 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