A frequency table shows the distribution of observations based on the options in a variable. Frequency tables are helpful to understand which options occur more or less often in the dataset. This is helpful for getting a better understanding of each variable and deciding if variables need to be recoded or not. There is no formula for a frequency table since it reports the count of each option in a variable.
For example, we can find the frequency of counties in California dataset using table()
function.
R automatically gets a frequency of these counties in alphabetical order.
Most common county in this dataset is Sonoma, but Alameda, Calaveras, Inyo, and Mendocino are only repeated once.