[R] adding group totals to a table

christopher snow snowch at coralms.com
Sun Dec 9 10:35:21 CET 2007

I have a table with two columns:

A   1
A   1
A   2
B   2
C   0

I would like to produce a third column that contains the counts of each 
unique combination of col1 and col2:

A   1  2
A   1  2
A   2  1
B   2  1
C   0  1

How can I do this in R?

Thanks in advance ...

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the R-help mailing list