draw_violin_panel: Draw a panel of violin or box plots.

View source: R/functions_special_plots.R

draw_violin_panelR Documentation

Draw a panel of violin or box plots.

Description

Draws violin or box plots for the specified variable set. Medians and IQR are presented as orange diamonds with whiskers. Points represent single observations.

Usage

draw_violin_panel(
  data,
  variables,
  split_factor = NULL,
  distr_geom = c("violin", "box"),
  non_zero = FALSE,
  point_size = 2,
  point_rim_color = "black",
  point_alpha = 0.5,
  point_hjitter = 0.15,
  point_wjitter = 0,
  dodge_w = 0.75,
  fill = "cornsilk4",
  plot_title = NULL,
  plot_subtitle = NULL,
  plot_tag = NULL,
  x_lab = "Variable value",
  cust_theme = ggplot2::theme_classic(),
  ...
)

Arguments

data

a data frame.

variables

names of the variables to plot.

split_factor

name of the splitting variable.

distr_geom

form of the distribution symbol: a violin or box plot.

non_zero

logical, should the zero values be removed?

point_size

size of data points.

point_rim_color

color of the data point rim, defaults to 'black'.

point_alpha

alpha of data points.

point_hjitter

point jitter height.

point_wjitter

point jitter width.

dodge_w

dodge width.

fill

fill color of the violins and data points, ignored when split_factor is provided.

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_violin or geom_box.

Value

a ggplot object.


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