tables / frequencies in R


Vinh Nguyen


May 14, 2009

At my previous internship, SAS was the software of choice for about 80% of the statistical work done; this rate was pulled down by me using/pushing for R and another co-worker using/pushing for Python.

One of the positive features of SAS is its PROC FREQ command. It gives useful summaries for contingency tables, such as row and column summary statistics and tests of different types. R's base function table is not full of bells and whistles. To get similar statistics as SAS's PROC FREQ, check out CrossTable from the gmodels package or the base function margin.table to get row/column totals. See this for examples.