two_category_tally: Plot counts of combinations of two category columns

Description Usage Arguments Value Examples

View source: R/tallies.R

Description

Plot counts of combinations of two category columns

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
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)

kviswana/ezEDA documentation built on July 1, 2021, 1:02 p.m.