vpPlot | R Documentation |
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.
vpPlot(x = rep("Data", length(y)), y, xaxt = "y", offsetXArgs = NULL, ...)
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 |
invisibly return the adjusted x positions of the points
offsetX
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.