Learn R Programming

volker (version 2.1.0)

.plot_bars: 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,
  base = NULL,
  title = NULL
)

Value

A ggplot object.

Arguments

data

Dataframe with the columns item, value, p, n.

category

Category for filtering the dataframe.

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.

base

The plot base as character or NULL.

title

The plot title as character or NULL.