Grouped Bar Chart

grouped_barchart(data, xvar, yvar, groupvar, chartcolors)

Arguments

data

dataframe input data

xvar

value x-axis variable

yvar

value y-axis variable

groupvar

Factor group variable

chartcolors

vector a vector of colors, the same number of levels as the group variable

Value

a ggplot object

Examples


grouped_barchart(
  data = comorbidities, xvar = "Comorbidities",
  yvar = "Prevalence", groupvar = "Severity",
  chartcolors = colfun()$fig4_colors
)