| cat_tbl | R Documentation |
cat_tbl() summarizes nominal or categorical variables,
returning frequency counts and percentages.
cat_tbl(data, var, na.rm = FALSE, only = NULL, ignore = NULL)
data |
A data frame. |
var |
A character string of the name of a variable in |
na.rm |
A logical value indicating whether missing values should be
removed before calculations. Default is |
only |
A character string or vector of character strings of the types
of summary data to return. Default is |
ignore |
An optional vector that contains values to exclude from |
A tibble showing the count and percentage of each category in var
Ama Nyame-Mensah
cat_tbl(data = nlsy, var = "gender")
cat_tbl(data = nlsy, var = "race", only = "count")
cat_tbl(data = nlsy,
var = "race",
ignore = "Hispanic",
only = "percent",
na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.