Re: [R] basic problem but can't solve it

2007-05-23 Thread Gabor Grothendieck
Use ave. Assuming DF is your 2 column data frame: ave(DF[,1], DF[,2], FUN = mean) On 5/22/07, Benoit Chemineau <[EMAIL PROTECTED]> wrote: > Hello, > I have a basic problem but i can't figure it out with the > table underneath. I would like to compute monthly averages. > I would like to have

Re: [R] basic problem but can't solve it

2007-05-23 Thread Christophe Pallier
If I understood correctly, the initial post asked for a vector of the same length as the original one. This is why I suggested: tapply(Measure,Month,mean)[as.character(Month)] btw, this is handy way to compute deviations from the means of subgroups (x - tapply(x, group, mean)[as.character(

Re: [R] basic problem but can't solve it

2007-05-22 Thread John Kane
aggregate(Measure, list(Month=Month), mean) --- Benoit Chemineau <[EMAIL PROTECTED]> wrote: > Hello, >I have a basic problem but i can't figure it out > with the > table underneath. I would like to compute monthly > averages. >I would like to have the average measure for > month #5 for t

Re: [R] basic problem but can't solve it

2007-05-22 Thread Christophe Pallier
tapply(Measure,Month,mean)[as.character(Month)] -- Christophe Pallier (http://www.pallier.org) On 5/22/07, Benoit Chemineau <[EMAIL PROTECTED]> wrote: > > Hello, >I have a basic problem but i can't figure it out with the > table underneath. I would like to compute monthly averages. >I w

Re: [R] basic problem but can't solve it

2007-05-22 Thread Gavin Simpson
On Tue, 2007-05-22 at 19:01 +0200, Benoit Chemineau wrote: > Hello, >I have a basic problem but i can't figure it out with the > table underneath. I would like to compute monthly averages. >I would like to have the average measure for month #5 for the first > three rows (the same number in

Re: [R] basic problem but can't solve it

2007-05-22 Thread Cody_Hamilton
th.ethz.ch Subject [R] basic problem but can't solve it 05/22/2007 10:01

[R] basic problem but can't solve it

2007-05-22 Thread Benoit Chemineau
Hello, I have a basic problem but i can't figure it out with the table underneath. I would like to compute monthly averages. I would like to have the average measure for month #5 for the first three rows (the same number in the first three lines) and the average measure for month #6 for the l