[S] Summary: Arguments to table()

Ross Darnell (R.E.Darnell@newcastle.ac.uk)
Mon, 29 Jun 1998 09:33:59 GMT0BST

Thanks for all the replies to my query which is included below.

The solution was a simple one.




Bill Venables gave some insight in stripping crosstabs to the bare

structure(crosstabs(~ . , X),
marginals = NULL, call = NULL, class = NULL)

I thank everyone who replied.


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