Skip to contents

This function plots a stacked bar of proportions for an input set of data

Usage

stacked_barplot(data, mapping, ...)

Arguments

data

the data

mapping

a aes mapping with at least x and fill. If facetting then group must contain the facet variable

...

passed to geom_bar

Value

a ggplot

Examples

stacked_barplot(
    ggplot2::diamonds,
    ggplot2::aes(x=cut, fill=clarity, group=color)
  )+
  ggplot2::facet_wrap(dplyr::vars(color))