two_category_tally {ezEDA}R Documentation

Plot counts of combinations of two category columns

Description

Plot counts of combinations of two category columns

Usage

two_category_tally(
  data,
  main_category,
  sub_category,
  separate = FALSE,
  position = "stack"
)

Arguments

data

A data frame or tibble

main_category, sub_category

Unquoted column names of two categories (can be factor, character or numeric)

separate

Boolean indicating whether the plot should be faceted or not

position

"stack" or "dodge"

Value

A ggplot plot object

Examples

two_category_tally(ggplot2::mpg, class, drv)
two_category_tally(ggplot2::mpg, class, drv, position = "dodge")
two_category_tally(ggplot2::mpg, class, drv, separate = TRUE)
two_category_tally(ggplot2::diamonds, cut, clarity)
two_category_tally(ggplot2::diamonds, cut, clarity, separate = TRUE)

[Package ezEDA version 0.1.1 Index]