count_cats: Counting Categories in a Var

View source: R/utils.R

count_catsR Documentation

Counting Categories in a Var

Description

Count the number of categories in a categorical variable, or count the categories of multiple categorical variables.

Usage

count_cats(data, cat_vars)

Arguments

data

dataset that contains the variables

cat_vars

names of categorical variables in a character vector

Value

number of categories in the dataset

Examples

count_cats(ggplot2::diamonds, c("cut"))
count_cats(ggplot2::diamonds, c("cut", "color"))

sarazong/SZRtools documentation built on Feb. 8, 2024, 6:49 a.m.