bar_chart: Bar chart

Description Usage Arguments Author(s) See Also Examples

View source: R/bar_chart.R

Description

Create a bar chart to easily visualize numeric and/or categorical data. This function is meant to be used with qtable, but only supports one grouping variable.

Usage

1
2
3
4
5
bar_chart(df, ..., groups = NULL, weight = NULL, margin = TRUE,
  margin_name = NULL, wrap = FALSE)

bar_chart_(df, vars, groups = NULL, weight = NULL, margin = TRUE,
  margin_name = NULL, wrap = FALSE)

Arguments

df

A data.frame or data.table.

...

Unquoted variable names passed to select.

groups

Variables to group by during aggregation.

weight

Name of a variable to weight by. Only used when margin = TRUE.

margin

If TRUE (the default), the first group will include a "Total".

margin_name

Optional: Give the margin a different name from "Total".

wrap

Optional: Call facet_wrap on variables in bar_chart.

vars

The variables to aggregate, as a character vector.

Author(s)

Kristian D. Olsen

See Also

line_chart

Examples

1

itsdalmo/tabulR documentation built on May 18, 2019, 7:11 a.m.