[S]: Arguments to table()

Ross Darnell (R.E.Darnell@newcastle.ac.uk)
Thu, 25 Jun 1998 12:00:10 GMT0BST

I am trying to construct a contingency table of factor levels defined
as (say 3) columns of a dataframe, X.

table(X) gives a one dimensional table.

apply(X,2,table) gives 3 marginal tables.

table(X$V1,X$V2,X$V3) gives the correct answer but isn't a useful
method for a general dataframe.

There is obviously a simple solution, but not so obvious to me.

Thanks in advance

Ross Darnell
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news