Wrapper around viol() to conveniently plot multiple violins on a single plot, analogous to the behavior of boxplot()
violins( x, data = NULL, group = NULL, wt = NULL, adjustto1 = TRUE, horiz = FALSE, order = NULL, xlab = "", ylab = "", col = "black", fill = "grey", lwd = 1, lty = 1, dscale = 1, xlim = NULL, ylim = NULL, spaces = "_", add = FALSE, ax = TRUE, srt = 45, adj = c(1, 0), na.rm = TRUE, ... )
x
: plotting statistic (numeric vector) or formula object from which a plotting statistic and grouping variable can be extracted (i.e. of form x~group)data
: data.frame object containing x and ygroup
: grouping variablewt
: optional vector of weights (default=NULL)adjustto1
: optional setting whether to adjust weights in each category to sum to 1 (default=TRUE)horiz
: logical indicating whether to plot horizontallyorder
: order of factor levels of categorical factorxlab
: x axis labelylab
: y axis labelcol
: vector of border colorsfill
: vector of fill colorslwd
: vector of line widthslty
: vector of line typesdscale
: density scaling factors (numeric) to apply to individual violinsxlim
: x limits (data limits used if NULL)ylim
: y limits (data limits used if NULL)spaces
: character string in group to replace with spaces for labels, if not NULLadd
: logical whether to add to existing plot (default: FALSE)ax
: whether to plot axessrt
: angle for categorical axis text rotationadj
: adjustment for axis labels (defaults to c(1,0), i.e. top right)na.rm
: logical indicating whether to tell viol() to remove NA values (defaults to TRUE)...
: other arguments to pass on to paleoDiv::viol() and plot()data.frame(p=rnorm(50), cat=rep(c("A","B","B","B","B"),10))->d violins(p~cat,d)
Useful links