Re: [Rd] calculating means per group

2008-09-04 Thread Prof Brian Ripley
- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens RFTW Verzonden: donderdag 4 september 2008 9:07 Aan: r-devel@r-project.org Onderwerp: [Rd] calculating means per group Hi all I have a very basic question, yet i have not found how to do it. Suppose my dataset looks like this: Year

Re: [Rd] calculating means per group

2008-09-04 Thread Kjell Konis
Hi Luc, First of all, questions like this should really be asked on the R-help mailing list. The tapply function does what you want: > year [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 Levels: 1 2 > area [1] a a a a a b b b b a a a a b b b b b Levels: a b > value [1] 20 25 28 31 23 25 28 23 19

Re: [Rd] calculating means per group

2008-09-04 Thread ONKELINX, Thierry
] calculating means per group Hi all I have a very basic question, yet i have not found how to do it. Suppose my dataset looks like this: YearAreavalue 1 a 20 1 a 25 1 a 28 1 a 31 1 a 23 1 b 25 1 b 28 1 b

[Rd] calculating means per group

2008-09-04 Thread RFTW
Hi all I have a very basic question, yet i have not found how to do it. Suppose my dataset looks like this: YearAreavalue 1 a 20 1 a 25 1 a 28 1 a 31 1 a 23 1 b 25 1 b 28 1 b 23 1 b