Description Usage Arguments Value Examples
View source: R/measure-distribution.R
Plot the distribution of a numeric (measure) column differentiated by a category
1 2 3 4 5 6 7 8 |
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) |
A ggplot plot object
1 2 3 4 5 | 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.