Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vpPlot

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

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

Plot Categorical Data Using Quasirandom Noise and Density Estimates

v0.4.5
GPL (>= 2)
Authors
Scott Sherrill-Mix, Erik Clarke
Initial release
2017-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.