draw_stat_panel: Draw a panel of statistic values.

View source: R/functions_special_plots.R

draw_stat_panelR Documentation

Draw a panel of statistic values.

Description

Draws a panel of specified distribution statistic (e.g. median or mean) in form of bars or lines.

Usage

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(),
  ...
)

Arguments

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 geom_ribbon

Value

a ggplot object.


PiotrTymoszuk/ExDA documentation built on Nov. 17, 2024, 5:46 p.m.