multVarPlot: multVarPlot

Description Usage Arguments Value Examples

Description

multVarPlot provides a simple interface for plotting multiple columns in a data.frame across common X and Y axes.

Usage

1
2
3
4
multVarPlot(data, varList, grouping, legendTitle = NULL,
  legendLabels = NULL, xlab = NULL, xlabels = NULL, ylab = NULL,
  ylabels = NULL, colourManual = NULL, shapeManual = NULL, title = NULL,
  errorBars = FALSE, errorBarWidth = 0.1, errorBarType = "se")

Arguments

data

data.frame containing variables for plotting

varList

Vector of variable names to plot across the x-axis

grouping

Variable name to use for grouping data

legendTitle

Title for the legend, given a grouping variable

legendLabels

Labels for the legend, given a grouping variable

xlab

X-axis label

xlabels

X-axis value labels to match to the varList variable names

ylab

Y-axis label

ylabels

Y-axis value labels

colourManual

Manual colour pallet for grouping variable levels

shapeManual

Manual shape pallet for grouping variable levels

title

Main title for plot

errorBars

If TRUE, error bars will be added to the plot

errorBarWidth

If errorBars==TRUE, width of the error bars

errorBarType

If errorBars==TRUE, error bar type: 'sd', 'se', or 'ci'

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#data(iris)
#l <- multVarPlot(data=iris,
#              varList= c("Sepal.Length", "Sepal.Width",
#                         "Petal.Length", "Petal.Width"),
#              grouping = "Species",
#              colourManual = c("blue", "red", "black"),
#              shapeManual = c(15, 16, 17),
#              errorBars = T,
#              errorBarType = "sd")
#l + theme(legend.position="bottom") +
#   scale_x_discrete("Measurement Type",
#                    labels=c("Sepal.Length"="SL",
#                             "Sepal.Width"="SW",
#                             "Petal.Length"="PL",
#                             "Petal.Width"="PW"))

TaylorAndrew/atPlot documentation built on May 9, 2019, 4:23 p.m.