One-way tabulation
If by
is not specified, tab
generates one-way tabulation of
a variable or multiple variables. The table is displayed
in Freq.
(frequency), Percent
(Relative Frequency) and Cum.
(Cumulative Relative frequency).
Two-way tabulation
Specifying by
leads to two-way tabulation. By default,
row percentages are displayed along with count data. If row.pct
is set to NULL
, it shows a count table without percentages. If set to
FALSE
, a table with column percentages is generated. P-values from
Chi-squared
and Fisher's Exact
tests are also shown, regardless
of displaying percentages.
Tabulating the whole dataset
This is helpful when the dataset has been processed and finalized.
The final dataset can be fed into the function without
inputting any variables. This automatically filters and generates
tables on variables with possible data types for tabulation. These
data types include character
, factor
, order factor
, and logical
.
Using colon :
to tabulate multiple variables
A colon separator :
can be used to generate one-way or two-way
tables efficiently.
Labels
Labels for corresponding variables are displayed below the
table.