View source: R/geom_half_violin.R
| geom_half_violin | R Documentation |
A violin plot is a compact display of a continuous distribution. It is a
blend of ggplot2::geom_boxplot() and ggplot2::geom_density(): a
violin plot is a mirrored density plot displayed in the same way as a
boxplot.
geom_half_violin(
mapping = NULL,
data = NULL,
stat = "half_ydensity",
position = "dodge",
...,
side = "l",
nudge = 0,
quantiles = NULL,
trim = TRUE,
scale = "area",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
side |
The side on which to draw the half violin plot. "l" for left, "r" for right, defaults to "l". |
nudge |
Add space between the violinplot and the middle of the space allotted to a given factor on the x-axis. |
quantiles |
If not |
trim |
If |
scale |
if "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
The half-violin plot accepts an optional split aesthethic to compare
data separated by a binary variable side-by-side.
Hintze, J. L., Nelson, R. D. (1998) Violin Plots: A Box Plot-Density Trace Synergism. The American Statistician 52, 181-184.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.