R packages for making one-way tables

infoart.ca
3 min readAug 24, 2022

--

A one-way or simple frequency table is the stepping stone into deeper exploratory analysis for categorical variables. R has a range of packages to cater to the need for beautiful frequency tables each with a unique flavour. So it’s a good idea to have them organized in one place so that one can quickly pick a suitable one during peak hours.

Here are some common packages I like to have in my everyday analysis:

table from base R

count from plyr

frq from sjmisc

freq from summarytools

A bit more verbose than frq, but informative nonetheless:

tabyl from janitor

One of my most favourite because of the cleanness of the output while still containing the three most important statistics: frequency, count, and percent

tab1 from the epidisplay

Currently my second most favourite. It takes a slightly longer than tabyl, but the quality and volume of output are well worth the millisecond.

Not necessarily the best quality barplot R can make, but it’s maybe the only one as of now that comes for free with a summary table.

The coolest thing about epiDisplay is that it allows ordering the categories in increasing or decreasing order.

freq from questionr

My most favorite one for being the least verbose and fastest of all, and giving me all the necessary info in a blink:

Remember to use the namespace question:: to avoid conflict with the freq command from summarytools.

--

--

infoart.ca
infoart.ca

Written by infoart.ca

Center for Social Capital & Environmental Research | Posts by Bishwajit Ghose, BI consultant and lecturer at the University of Ottawa

No responses yet