plot_cs_hsa: Visualize Constrained HespDiv Sensitivity Analysis Results

View source: R/plot_cs_hsa.R

plot_cs_hsaR Documentation

Visualize Constrained HespDiv Sensitivity Analysis Results

Description

Displays the alternative (subsampled) hespdiv subdivisions and the basal (original) hespdiv subdivision on one or multiple plots, illustrating how the split-lines vary across different ranks. Additionally, for each alternative split-line (which is defined by a start and end coordinate), the function aggregates identical endpoints and overlays their counts on the plot.

Usage

plot_cs_hsa(
  obj,
  type = 1,
  rank = NULL,
  col_basal = "gray20",
  main,
  col_boundary = 7,
  col_alternatives = "lightyellow3",
  max_lwd = 2.5,
  min_lwd = 0.75,
  alpha_alt = 0.6
)

Arguments

obj

An object of class hsa_constrained, the output of hsa_sample_constrained.

type

An integer indicating the type of plot. Defaults to 1.

1

A single plot overlaying all alternative lines and the basal lines, colored or width-coded by rank.

2

Multiple plots, each corresponding to a specific rank. Alternative lines are displayed in a user-defined color (default "lightyellow3"), with the basal line highlighted in another color.

rank

Integer. Optional. When type = 2, if provided the function will only generate plots for the specified rank. If NULL (default), plots for all unique ranks will be produced.

col_basal

Character or numeric specifying the color of basal split-lines (default "gray20").

main

Character. Title for the plot(s).

col_boundary

Character or numeric specifying the color of the outer (first) polygon boundary (default 7).

col_alternatives

Character or numeric specifying the color of alternative split-lines (default "lightyellow3").

max_lwd

Numeric. The maximum line width for the highest-ranked split-line (default 2.5).

min_lwd

Numeric. The minimum line width for the lowest-ranked split-line (default 0.75).

alpha_alt

Numeric in the range [0, 1]. The transparency of alternative split-lines (default 0.6).

Details

  • In type = 1, the function creates a single plot showing all alternative split-lines overlaid on the first polygon boundary, plus all basal split-lines of the hespdiv basis object.

  • In type = 2, the function creates separate plots, each focusing on polygons of a specific rank, drawing alternative lines in the user-specified color (with transparency) and the basal line in another color or line width. If a specific rank is provided, only that rank is plotted.

  • In both cases, after drawing the alternative split-lines the function aggregates their endpoints (start and end coordinates) and overlays the count at each unique coordinate using text().

Value

NULL. The function is called for its side effect of generating one or more plots.

See Also

Other functions for hespdiv sensitivity analysis: change_base(), hsa(), hsa_detailed(), hsa_quant(), hsa_sample_constrained(), plot_hsa(), plot_hsa_q()

Other HespDiv visualization options: blok3d(), create_gif(), dendro(), plot.nullhespdiv(), plot_hespdiv(), plot_hsa(), plot_hsa_q(), poly_scheme(), polypop()


hespdiv documentation built on May 21, 2026, 5:09 p.m.