count_cats | R Documentation |
Count the number of categories in a categorical variable, or count the categories of multiple categorical variables.
count_cats(data, cat_vars)
data |
dataset that contains the variables |
cat_vars |
names of categorical variables in a character vector |
number of categories in the dataset
count_cats(ggplot2::diamonds, c("cut"))
count_cats(ggplot2::diamonds, c("cut", "color"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.