[R] Newbie: 'table' output in columns rather than matrix

Matthew Pettis matthew.pettis at gmail.com
Fri Sep 12 04:34:17 CEST 2008


Hi,

Coming to R from SAS...

I have a data.frame A with 2 long factors "x" and "y".  I want to get
a count of the number of rows with each level of "x" and "y" jointly.
'table' seemed like it would work, but as I have many levels, the
matrix output is pretty useless to me (and I don't care about zero
values).  How can I get output that looks like:

A$x A$y Freq
------ ----- -------
x1    y1    8
x1    y3   10
...

Thanks a ton,
Matt

--
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas



More information about the R-help mailing list