Skip to contents

Visualizes p-value distributions for selected features using a stacked histogram. The fill color of each bin segment reflects the binned version of the chosen fill variable.

Usage

plot_pvalue_distribution(
  data,
  x_var,
  fill_var = NULL,
  features = NULL,
  title = NULL,
  x_label = x_var,
  y_label = "Count",
  bins = 50,
  bin_width = 0.5
)

Arguments

data

A data frame containing at least the columns feature, and user-specified x_var and fill_var.

x_var

Name of the column to use for the x-axis (e.g., "p_value").

fill_var

Name of the column to use for fill coloring (e.g., "T_obs").

features

Character vector of feature names to include in the plot. If NULL, the first 9 unique features in feature are used.

title

Optional character string to set the plot title.

x_label

Label for the x-axis.

y_label

Label for the y-axis. Defaults to "Count".

bins

Integer. Number of bins to use for the histogram (default is 50).

bin_width

Numeric. Width used to bin the fill variable (default is 0.5).

Value

A ggplot2 object showing facetted histograms.