measure_distribution_by_category {ezEDA}R Documentation

Plot the distribution of a numeric (measure) column differentiated by a category

Description

Plot the distribution of a numeric (measure) column differentiated by a category

Usage

measure_distribution_by_category(
  data,
  measure,
  category,
  type = "hist",
  separate = FALSE,
  bwidth = NULL
)

Arguments

data

A data frame or tibble

measure

Unquoted column name of measure (containing numbers)

category

Unquoted column name of category (can be factor, character or numeric)

type

Histogram ("hist") or Boxplot ("box")

separate

Boolean specifying whether to plot each category in a separate facet

bwidth

width of bin for histogram (by default uses binwidth for 30 bins)

Value

A ggplot plot object

Examples

measure_distribution_by_category(ggplot2::diamonds, price, cut)
measure_distribution_by_category(ggplot2::mpg, hwy, class)
measure_distribution_by_category(ggplot2::diamonds, price, cut, separate = TRUE)
measure_distribution_by_category(ggplot2::mpg, hwy, class, separate = TRUE)
measure_distribution_by_category(ggplot2::mpg, hwy, class, "box")

[Package ezEDA version 0.1.1 Index]