On 12/09/2008, at 2:34 PM, Matthew Pettis wrote:

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
...

as.data.frame(with(A,table(x,y)))

        cheers,

                Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to