plot_hsa: Visualize the stability of hespdiv polygons

View source: R/plot_hsa.R

plot_hsaR Documentation

Visualize the stability of hespdiv polygons

Description

The function uses hespdiv sensitivity analysis results to visually demonstrate the stability of the basal hespdiv subdivision. This is achieved by displaying both alternative and basal hespdiv subdivisions on the same plot.

Usage

plot_hsa(
  obj,
  alpha = 0.6,
  split.col = "gray20",
  pnts.col = NULL,
  pol.col = "7",
  type = 1,
  basal.col = 2,
  max.lwd = 3,
  min.lwd = 0.5,
  split.col.seed = NULL,
  newplot = TRUE,
  seperated = TRUE
)

Arguments

obj

An object of class hsa

alpha

The alpha value for transparency of split lines. Default is 0.6.

split.col

Color of alternative subdivision split-lines. Default is "gray20".

pnts.col

The color of data points. Default is NULL.

pol.col

The color of polygons. Default is "7".

type

An integer indicating the type of plot. Default is 1.

basal.col

The color of basal subdivision split-lines.

max.lwd

The maximum line width for split-lines. Default is 3.

min.lwd

The minimum line width for split-lines. Default is 0.5.

split.col.seed

A seed for generating random colors for split lines. Default is NULL.

newplot

Create a plot in new device?

seperated

Boolean. When type is >= 3, open a new graphical device for each rank?

Details

The type parameter determines the type of plot generated:

1

Basic plot: displays the alternative and basal hespdiv subdivisions on the same plot without split-line ranks or titles.

2

Plot with split-line ranks: includes split-line ranks in the plot. Each split-line is assigned a different line width based on its rank.

3

Plot with separate ranks: generates multiple plots, each representing split-line ranks up to a certain value.

4

Plot with separate and isolated ranks: similar to mode 3 but isolates split-line ranks. Generates multiple plots, each representing a specific split-line rank.

If the alternative subdivisions spatially converge but the basal subdivision lies far from the zone of convergence, you can use change_base to select a more representative alternative subdivision to serve as the basal subdivision. However, you should verify that the arguments used in that subdivision are appropriate.

Value

No return value, called for plotting sensitivity analysis results.

Note

newplot allows the legend to be rendered correctly in types 2 and 3, and helps with line rendering in general when drawing in an active device (use broom otherwise to delete devices).

Author(s)

Liudas Daumantas

See Also

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

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


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