dot-plot_bars: Helper function: plot grouped bar chart

.plot_barsR Documentation

Helper function: plot grouped bar chart

Description

Helper function: plot grouped bar chart

Usage

.plot_bars(
  data,
  category = NULL,
  ci = FALSE,
  scale = NULL,
  limits = NULL,
  numbers = NULL,
  orientation = "horizontal",
  base = NULL,
  title = NULL
)

Arguments

data

Data frame with the columns item, value, p, n and optionally p_item. If p_item is provided, the column width is generated according the p_item value, resulting in a mosaic plot.

category

Category for filtering the data frame.

ci

Whether to plot error bars for 95% confidence intervals. Provide the columns ci.low and ci.high in data.

scale

Direction of the scale: 0 = no direction for categories, -1 = descending or 1 = ascending values.

numbers

The values to print on the bars: "n" (frequency), "p" (percentage) or both.

orientation

Whether to show bars (horizontal) or columns (vertical)

base

The plot base as character or NULL.

title

The plot title as character or NULL.

Value

A ggplot object.


volker documentation built on April 12, 2025, 9:16 a.m.