Learn R Programming

structSSI (version 1.2.1)

PlotHypTree: Interactively VIsualize a HypothesisTree

Description

Generates a D3.js-based visualization of a HypothesisTree object. Nodes are colored by p-value, and hovering over a node displays its name and either the raw or adjusted p-value, depending on the adjust argument.

Usage

PlotHypTree(
  hyp.tree,
  adjust = TRUE,
  return_script = FALSE,
  width = 900,
  height = 500,
  base_font_size = 12,
  output_file_name = NULL
)

Value

If return_script is TRUE, returns a character string containing the HTML/JS code. Otherwise, writes the visualization to an HTML file and opens it in the default browser (if interactive).

Arguments

hyp.tree

An object of class HypothesisTree.

adjust

Logical; if TRUE, use adjusted p-values for coloring. If FALSE, use raw p-values.

return_script

Logical; if TRUE, return the HTML/JS script as a character string instead of writing to a file and opening in a browser.

width

Width of the plot in pixels. Default is 900.

height

Height of the plot in pixels. Default is 500.

base_font_size

Base font size for node labels. Default is 12.

output_file_name

Optional file name for the HTML output. If NULL, a name is generated automatically.

Details

The visualization displays the hierarchical structure of hypotheses. Node color reflects the p-value, and hovering over a node shows its name and p-value.