count_obs | R Documentation |
Count the number of observations in the smallest/largest category within a categorical variable, or the smallest/largest category defined by multiple categorical variables.
count_obs(data, cat_vars, fxn = c(min, max))
data |
dataset that contains the variables |
cat_vars |
names of categorical variables in a character vector |
fxn |
the min or max function |
number of observation
count_obs(ggplot2::diamonds, c("cut"), min)
count_obs(ggplot2::diamonds, c("cut", "color"), max)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.