Re: [R] Writing My Own Function to Use With aggregate

2010-09-01 Thread Dennis Murphy
Hi: aggregate() is not well suited for summarization when the summary function takes multiple input arguments. Better choices for this type of summary are packages plyr, as David mentioned, and data.table. Here's a toy example to illustrate. The fake data contain two grouping variables as factors

Re: [R] Writing My Own Function to Use With aggregate

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 6:29 PM, Adrian Ng wrote: Dear R-Users, I have been using R for about 1 week and recently learned about the Aggregate function, and from reading online it seems like it is comparable to a SQL group by to perform summary functions. I am looking to do a summary function

[R] Writing My Own Function to Use With aggregate

2010-09-01 Thread Adrian Ng
Dear R-Users, I have been using R for about 1 week and recently learned about the Aggregate function, and from reading online it seems like it is comparable to a SQL group by to perform summary functions. I am looking to do a summary function, such as SUM/MIN, but instead of these basic functi