View source: R/functions_special_plots.R
draw_stat_panel | R Documentation |
Draws a panel of specified distribution statistic (e.g. median or mean) in form of bars or lines.
draw_stat_panel(
data,
variables,
split_factor = NULL,
stat = c("mean", "median"),
err_stat = c("none", "sd", "se", "2se", "iqr", "95perc"),
form = c("bar", "line"),
alpha = 0.5,
fill = "cornsilk4",
dodge_w = if (form == "bar") 0.9 else 0,
plot_title = NULL,
plot_subtitle = NULL,
plot_tag = NULL,
x_lab = "Mean",
cust_theme = ggplot2::theme_classic(),
...
)
data |
a data frame. |
variables |
names of the variables to plot. |
split_factor |
name of the splitting variable. |
stat |
distribution statistic, currently mean or median supported. |
err_stat |
error/distribution width statistic, SD ('sd'), SEM ('se'), 95 ('95perc') are currently supported. |
form |
for of the plot: bar (default) or line. |
alpha |
alpha of the bar or distribution width ribbon. |
fill |
fill color of the violins and data points, ignored when split_factor is provided. |
dodge_w |
dodge width. |
plot_title |
plot title. |
plot_subtitle |
plot subtitle. |
plot_tag |
plot tag. |
x_lab |
x axis title. |
cust_theme |
custom ggplot theme. |
... |
extra arguments passed to |
a ggplot object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.