From: jose silva <chess.player_at_oninet.pt>

Date: Fri 22 Apr 2005 - 01:31:01 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 22 01:33:42 2005

Date: Fri 22 Apr 2005 - 01:31:01 EST

I know this question is very simple, but I am not figure it out

I have the data frame:

*
*

test<- data.frame(year=c(2000,2000,2001,2001),x=c(54,41,90,15), y=c(29,2,92,22), z=c(26,68,46,51))

test

*
*

I want to sum the vectors x, y and z within each year (2000 and 2001) to obtain this:

*
*

year x y z

*
*

I tried tapply but did not work (or probably I do it wrong)

*
*

Any suggestions?

*
*

silva

[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 22 01:33:42 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:31:21 EST
*