add_violin {tidyplots} | R Documentation |
Add violin plot
Description
Add violin plot
Usage
add_violin(
plot,
dodge_width = NULL,
alpha = 0.3,
saturation = 1,
draw_quantiles = NULL,
trim = FALSE,
linewidth = 0.25,
scale = "width",
...
)
Arguments
plot |
A |
dodge_width |
For adjusting the distance between grouped objects. Defaults
to |
alpha |
A |
saturation |
A |
draw_quantiles |
If |
trim |
If |
linewidth |
Thickness of the line in points (pt). Typical values range between |
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. |
... |
Arguments passed on to the |
Value
A tidyplot
object.
Examples
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_violin()
# Changing arguments:
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_violin(saturation = 0.6)
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_violin(draw_quantiles = c(0.25, 0.5, 0.75))
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_violin(trim = TRUE)
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_violin(linewidth = 1)