vpPlot: Plot data using offsets by quasirandom noise to generate a...

View source: R/violinPoint.R

vpPlotR Documentation

Plot data using offsets by quasirandom noise to generate a violin point plot

Description

Arranges data points using quasirandom noise (van der Corput sequence), pseudorandom noise or alternatively positioning extreme values within a band to the left and right to form beeswarm/one-dimensional scatter/strip chart style plots. That is a plot resembling a cross between a violin plot (showing the density distribution) and a scatter plot (showing the individual points) and so here we'll call it a violin point plot.

Usage

vpPlot(x = rep("Data", length(y)), y, xaxt = "y", offsetXArgs = NULL, ...)

Arguments

x

a grouping factor for y (optional)

y

vector of data points

xaxt

if 'n' then no x axis is plotted

offsetXArgs

a list with arguments for offsetX

...

additional arguments to plot

Value

invisibly return the adjusted x positions of the points

See Also

offsetX

Examples

dat<-list(
  'Mean=0'=rnorm(200),
  'Mean=1'=rnorm(50,1),
  'Bimodal'=c(rnorm(40,-2),rnorm(60,2)),
  'Gamma'=rgamma(50,1)
)
labs<-factor(rep(names(dat),sapply(dat,length)),levels=names(dat))
vpPlot(labs,unlist(dat))

vipor documentation built on May 29, 2024, 7:09 a.m.