split_violin: Split violin plot

Description Usage Arguments Value

View source: R/Plotting.R

Description

This type of plot takes a numeric vector and splits it twice. Once using a first categorical variable with any number of levels and then and then a second time using a second categorical variable with exactly TWO levels. A density curve will be estimated and side-by-side violin plots will be produced.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
split_violin(
  x,
  s1,
  s2,
  cols = c("cornflowerblue", "salmon"),
  ylb = "",
  rug = FALSE,
  legpos = "topleft",
  rotate_xlabels = NULL,
  ...
)

Arguments

x

a numeric variable to be split in two ways

s1

categorical variable used for the first split

s2

categorical variable used for the second split

cols

vector of lenght 2 indicating colors in R (hex, integer or plane name)

ylb

default for y-axis, could be changed if you know the nature of x (e.g. Z-score)

rug

logical, whether to plot the data points as a rug

legpos

character, indicating the position of the legend

rotate_xlabels

integer, if not NULL, will be used as degree rotation of x labels

Value

a plot will be send to the graphics output


fossbert/binilib documentation built on April 23, 2021, 10:31 p.m.