How do I get a contingency table?

In base R, use table or xtabs: with(warpbreaks, table(wool, tension)) tension wool L M H A 9 9 9 B 9 9 9 xtabs(~wool+tension, data=warpbreaks) tension wool L M H A 9 9 9 B 9 9 9 The gmodels packages has a function CrossTable that gives output similar to what users of SPSS or … Read more