[R] aggregate in R

2011-02-22 Thread Hongwei Dong
Hi, R users, I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35) y-data.frame(y) I want to aggregate a and b in y by x. With a, I want to use function mean; with b, I want to use function sum. I tried

Re: [R] aggregate in R

2011-02-22 Thread Ista Zahn
, mean.a=mean(a), sum.b=sum(b)) Best, Ista On Tue, Feb 22, 2011 at 5:25 PM, Hongwei Dong pdxd...@gmail.com wrote: Hi, R users, I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35) y-data.frame(y) I want

Re: [R] aggregate in R

2011-02-22 Thread Seeliger . Curt
Gary/Hongwei writes: I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35) y-data.frame(y) I want to aggregate a and b in y by x. With a, I want to use function mean; with b, I want to use function

Re: [R] aggregate in R

2011-02-22 Thread jim holtman
, I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35) y-data.frame(y) I want to aggregate a and b in y by x. With a, I want to use function mean; with b, I want to use function sum. I tried

Re: [R] aggregate in R

2011-02-22 Thread Jeff Newmiller
Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Hongwei Dong pdxd...@gmail.com wrote: Hi, R users, I'm wondering how I can aggregate data in R with different functions for different

Re: [R] aggregate in R

2011-02-22 Thread Jannis
: Hongwei Dong pdxd...@gmail.com Betreff: [R] aggregate in R An: r-help@r-project.org Datum: Dienstag, 22. Februar, 2011 22:25 Uhr Hi, R users, I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35

Re: [R] aggregate in R

2011-02-22 Thread Sebastián Daza
...@gmail.com wrote: Hi, R users, I'm wondering how I can aggregate data in R with different functions for different columns. For example: x-rep(1:5,3) y-cbind(x,a=1:15,b=21:35) y-data.frame(y) I want to aggregate a and b in y by x. With a, I want to use function mean; with b, I want to use function sum