Helper function: plot grouped bar chart
.plot_bars(
data,
category = NULL,
ci = FALSE,
scale = NULL,
limits = NULL,
numbers = NULL,
base = NULL,
title = NULL
)
A ggplot object.
Dataframe with the columns item, value, p, n.
Category for filtering the dataframe.
Whether to plot error bars for 95% confidence intervals. Provide the columns ci.low and ci.high in data.
Direction of the scale: 0 = no direction for categories, -1 = descending or 1 = ascending values.
The values to print on the bars: "n" (frequency), "p" (percentage) or both.
The plot base as character or NULL.
The plot title as character or NULL.