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
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(
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
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
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
th.ethz.ch Subject
[R] basic problem but can't solve
it
05/22/2007 10:01
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