multijitter function

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

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

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

data.frame(p=rnorm(50), cat=rep(c("A","B","B","B","B"),10))->d multijitter(p~cat,d, add=FALSE)
  • Maintainer: Darius Nau
  • License: GPL (>= 3)
  • Last published: 2025-03-23

Useful links