| ggvio | R Documentation |
Create violin plots for a chosen variable by all discrete covariates in a dataset. Numeric variables will be dropped, except the chosen variable to plot.
ggvio(d, var, cats, alpha = 0.1, show = TRUE, nsub = TRUE, ...)
d |
|
var |
|
cats |
|
alpha |
|
show |
|
nsub |
|
... |
Additional arguments for ggplot2::geom_violin. |
A ggplot object.
d = mtcars |> mutate(across(c(am,carb,cyl,gear,vs),factor))
d |> ggvio(mpg)
d |> ggvio(mpg,alpha=0.5)
d |> ggvio(mpg,show=FALSE)
d |> ggvio(mpg,nsub=FALSE)
d |> ggvio(mpg,c(cyl,vs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.