Hi,
#dput()
dat1<-
structure(list(a1 = c(432L, 0L, 1295L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 432L, 0L, 432L, 0L, 0L, 0L, 0L, 432L, 0L, 432L, 0L, 0L, 0L,
0L, 0L, 864L, 0L, 432L, 432L, 1296L, 0L, 432L, 0L, 0L, 432L,
0L, 863L, 432L, 0L, 432L, 432L, 0L, 432L, 0L, 0L, 432L, 864L,
0L, 432L, 0L, 432L, 0L,
Thank you for your help. Appreciate it a lot! I am using appropriate names,
just here as an example I used data :)
2013/5/15 Rui Barradas
> Hello,
>
> Try the following.
>
> aggregate(. ~ interval, data = data, mean)
>
>
> Also, 'data' is an R function, you should use some other name, such a
Hello,
Try the following.
aggregate(. ~ interval, data = data, mean)
Also, 'data' is an R function, you should use some other name, such as
'dat'.
Hope this helps,
Rui Barradas
Em 15-05-2013 10:46, Simonas Kecorius escreveu:
Dear R users,
Here is my data:
"a1""a2""a3""a4"
Thank you so much, it did what I need!
2013/5/15 Pascal Oettli
> Hi,
>
> I renamed your data.frame "df", as "data" is a built-in function.
>
> You can achieve what you are looking for with:
>
> > datf.mean <- with(datf, aggregate(datf[,-6], list(interval=interval),
> mean))
>
> Advice:
> Next t
It looks like you should use "by" instead of "tapply".
Anyway, if you use dput(data) for sharing your data, it is much easier
to get help.
Best,
Nello
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Simonas Kecorius
Sent: Mitt
Hi,
I renamed your data.frame "df", as "data" is a built-in function.
You can achieve what you are looking for with:
> datf.mean <- with(datf, aggregate(datf[,-6], list(interval=interval),
mean))
Advice:
Next time, use "dput" when you submit a data set to R-help.
Hope this helps,
Pascal
6 matches
Mail list logo