table(...)
table uses the cross-classifying factors provided as arguments to build a contingency table of the counts at each combination of factor levels. Examples # simple two-way contingency table tab <- table(sex,age)