box_chart: Create box chart

Description Usage Arguments Details Examples

View source: R/box-chart.R

Description

This function creates an overlay plotting a bar chart in ggplot

Usage

1
2
3
box_chart(data, y, x = NULL, title = NULL, sub.title = NULL,
  flip = FALSE, legend.names = NULL, y.title = NULL, x.title = NULL,
  box.colours = FALSE, min.lim = NULL, max.lim = NULL, ...)

Arguments

data

data frame containing data for plotting

y

character string specifying column name in data that should be y variable

x

character string specifying column name in data that should be x variable

title

character string specifying chart title

sub.title

character string specifying chart sub title

flip

logical indicating whether box chart should be flipped or not

legend.names

character string specifying legend names (default is NULL)

y.title

character string specifying y-axis title

x.title

character string specifying x-axis title

box.colours

logical indicating whether boxes should have same colours or not

min.lim

numeric setting minimum limit on y-axis

max.lim

numeric setting maximum limit on y-axis

Details

Legend names can be modified through a character vector with same length as number of categorical variables in the x variable. If not set, legend names will take its names from the x variable.

Examples

1
2
3
box_chart(mtcars, "mpg", "cyl", title = "Miles per gallon across cylinders",
sub.title = "(Period 2000-2005)", y.title = "Miles per gallon",
x.title = "Cylinders", legend.position = "none")

pgarnry/ggplotHelper documentation built on May 25, 2019, 2:54 a.m.