simple_bar: Create a simple bar graph

Description Usage Arguments Value

View source: R/simple_plots.R

Description

Create a simple bar graph

Usage

1
2
3
4
5
6
7
8
9
simple_bar(
  data,
  title,
  subtitle = NULL,
  caption = NULL,
  stacked = FALSE,
  percent = FALSE,
  grid = FALSE
)

Arguments

data

A data frame with 2-4 columns. Data should be formatted in the following way: column 1 is the x-axis variable, column 2 is the y-axis variable, column 3 is the coloring variable, column 4 is the variable split the data set on to create side by side graphs

title

A string containing the title of the graph

subtitle

A string containing the subtitle of the graph. Default is no subtitle

caption

string containing the caption of the graph. Default is no caption

stacked

Stacks bars on top of each other instead of putting them next to each other. Only works for data sets of 3 or 4 variables. Default is FALSE

percent

Converts stacked bars to percentages so they are all the same height. Default is FALSE.

grid

Shows major grid lines, default is FALSE

Value

A ggplot graph


srhen/mustangnews documentation built on June 15, 2020, 3:45 a.m.