plotsplitviolin_withthres: Plot Split Violin with Thresholds

View source: R/plotsplitviolin_withthres.R

plotsplitviolin_withthresR Documentation

Plot Split Violin with Thresholds

Description

note for this to work properly, subset data frame ahead of time such that there fill_var is a factor of 2 levels -CH 2023-09-02

Usage

plotsplitviolin_withthres(
  data,
  x_var,
  y_var,
  fill_var,
  dodge_width = 0.8,
  color_palette = c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00",
    "#CC79A7"),
  facetformula_var,
  title_var,
  thres_var,
  perc_var,
  perclabely = 2,
  labelsize = 6,
  basesize_var = 18
)

Arguments

data

A data frame containing the variables used for plotting.

x_var

The variable name for the x-axis.

y_var

The variable name for the y-axis.

fill_var

The variable name for the fill color.

dodge_width

The width of the dodge for grouped violins (default = 0.8).

color_palette

A vector of colors to use for the plot (default = cbbPalette).

facetformula_var

The formula specifying the faceting variables.

title_var

The title for the plot.

thres_var

The variable name for the threshold.

perc_var

The variable name for the percentage label.

labelsize

The font size for the percentage label (default = 6).

basesize_var

The base font size for the plot (default = 18).

facet_strvar

The variable name for facet labels.

perclabelx

The x-coordinate adjustment for the percentage label (default = 1).

facet_var

The variable name for faceting (optional).

Details

This function creates a split violin plot with thresholds using ggplot2.

Value

A ggplot object representing the half violin plot with thresholds.


chris-hsiung/bears01 documentation built on April 9, 2024, 2:01 a.m.