[R] Table Help

From: McMurtry, Benjamin G. <BENJAMIN.G.MCMURTRY_at_saic.com>
Date: Wed 25 May 2005 - 06:48:41 EST


I have a very large table that I want to add some of the certain rows.

The table is as follows:

Username1 2
Username1 4
Username2 6
Username2 10
Username3 12
Username3 10
Username3 16

Etc ....

The data is sorted by Column 1 (Ie the username) then by columm 2 (The numbers). I do not know how many of each username I will have.

I want to combine the rows so it would be as follows:

Username1 6
Username2 16
Username3 38

Is there easy way using a feature like bind to sum all of collumn two where column 1 is the same?

Thanks!
Ben



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 Wed May 25 07:02:21 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:01 EST