line_chart: Create line chart

Description Usage Arguments Details

View source: R/line-chart.R

Description

This function is a convinient overlay for creating a beautiful line plot using ggplot2

Usage

1
2
3
4
5
line_chart(data = NULL, y, x = NULL, group = NULL, title = NULL,
  sub.title = NULL, x.title = NULL, y.title = NULL, vline = NULL,
  hline = NULL, x.interval = NULL, date.format = NULL, y.min = NULL,
  y.max = NULL, ribbon.lwr = NULL, ribbon.upr = NULL,
  legend.names = NULL, ribbon.names = NULL, aspect.ratio = 1.61, ...)

Arguments

data

data frame containing data for plotting

y

specifying column name in data that should be y variable

x

specifying column name in data that should be x variable

group

specifies the label for splitting data into multiple lines

title

character string specifying chart title

sub.title

character string specifying chart sub title

x.title

character string specifying x-axis title

y.title

character string specifying y-axis title

vline

numeric specifying position of vertical line

hline

numeric specifying position of horizontal line

x.interval

numeric used to set number of breaks when scaling the x variable

date.format

character vector specifying the date label (see details)

y.min

numeric setting the minimum value on y-axis

y.max

numeric setting the maximum value on y-axis

ribbon.lwr

character string specifying column with values for lower ribbon

ribbon.upr

character string specifying column with values for upper ribbon

legend.names

character vector setting custom legend names

ribbon.names

character string specifying custom legend name for ribbon

Details

Format codes for time series classes are defined in strftime. If date.format is set to NULL the date format will be set to the most used format for each time series class.

The ellipsis is used to pass on arguments to the plot_theme function. Primary use is to specify the legend.position to either "left", "right", "bottom", "top" or "none". Arguments can also be sent to plot_theme function to adjust plot margins - see function for more details.


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