Learn R Programming

diceplot (version 0.2.0)

create_custom_domino_legends: Create custom legends for a domino plot

Description

Create custom legends for a domino plot

Usage

create_custom_domino_legends(
  contrast_levels,
  var_positions,
  var_id,
  contrast,
  logfc_colors,
  logfc_limits,
  color_scale_name,
  size_scale_name,
  min_dot_size,
  max_dot_size,
  size_limits = NULL,
  size_breaks = NULL,
  legend_text_size = 8,
  p_label_formatter = function(lp) sprintf("%.2g", 10^-lp)
)

Value

A combined ggplot object with three aligned legends.

Arguments

contrast_levels

Character vector of contrast level names.

var_positions

Data frame with variable positions.

var_id

Column name for the variable identifier.

contrast

Column name for the contrast variable.

logfc_colors

Named vector with "low", "mid", "high" colours.

logfc_limits

Numeric vector (length 2) for logFC scale limits.

color_scale_name

Title for the logFC colour legend.

size_scale_name

Title for the p-value size legend.

min_dot_size, max_dot_size

Numeric dot-size range.

size_limits, size_breaks

Passed to scale_size_continuous().

legend_text_size

Base font size for legend text.

p_label_formatter

A function used to format the size legend labels (typically for p-values). Default is function(lp) sprintf("%.2g", 10^-lp).