Learn R Programming

paleoDiv (version 0.4.6)

multijitter: Wrapper around jitterp that plots multiple jitter plots on the same plotting device (analogous to violins())

Description

Wrapper around jitterp that plots multiple jitter plots on the same plotting device (analogous to violins())

Usage

multijitter(
  x,
  data = NULL,
  group = NULL,
  horiz = FALSE,
  order = NULL,
  xlab = "",
  ylab = "",
  col = "black",
  pch = 16,
  spaces = "_",
  width = 0.1,
  xlim = NULL,
  ylim = NULL,
  add = TRUE,
  ax = FALSE,
  srt = 45,
  adj = c(1, 0),
  ...
)

Arguments

x

plotting statistic (numeric vector) or formula object from which a plotting statistic and grouping variable can be extracter (i.e. of form x~group)

data

data.frame object containing x and y

group

grouping variable

horiz

logical indicating whether to plot horizontally

order

order of factor levels of categorical factor

xlab

x axis label

ylab

y axis label

col

vector of border colors

pch

vector of symbols

spaces

character string in group to replace with spaces for labels, if not NULL

width

standard deviation for jitter

xlim

x limits (data limits used if NULL)

ylim

y limits (data limits used if NULL)

add

logical whether to add to existing plot (default: TRUE)

ax

whether to plot axes

srt

angle for categorical axis text rotation

adj

adjustment for axis labels (defaults to c(1,0), i.e. top right)

...

other arguments to pass on to jitterp() and plot()

Examples

Run this code
data.frame(p=rnorm(50), cat=rep(c("A","B","B","B","B"),10))->d
multijitter(p~cat,d, add=FALSE)

Run the code above in your browser using DataLab