lp_bar_chart: A bar chart with percentages

View source: R/lp_bar_chart.R

lp_bar_chartR Documentation

A bar chart with percentages

Description

A bar chart with percentages

Usage

lp_bar_chart(
  data,
  var,
  .pct_reorder = TRUE,
  .drop_levels = TRUE,
  .hjust = -0.2,
  .xlab = NULL,
  .ylab = NULL,
  .title = NULL,
  .bar_col = "#EE5C42"
)

Arguments

data

The dataset

var

The variable to plot

.pct_reorder

Logical length 1. Reorder the bars based on value?

.drop_levels

Logical length 1. Drop unused levels in the factor when counting ? i.e. do not show '0' count

.hjust

Numeric length 1. The jhust for the value labels.

.xlab

The x-axis label. Defaults to the variable name

.ylab

The y-axis label. Defaults to the variable name

.title

Optional title

.bar_col

The colour of the bars

Value

A ggplot object

Examples

lp_bar_chart(iris, Species)

lefkiospaikousis/lpmisc documentation built on July 19, 2022, 3:16 a.m.