Skip to contents

Visualize node degree centrality measures in psychometric hypergraphs.

Usage

plot_node_degree(
  object,
  scale = c("raw", "zscore", "relative"),
  degree_type = c("degree", "weighted_degree"),
  graph_type = c("redundant", "synergistic", "full"),
  style = c("line", "point", "both"),
  orientation = c("vertical", "horizontal"),
  rotate_labels = TRUE,
  sort_nodes = FALSE,
  labels = NULL
)

Arguments

object

A psychHypergraph object produced by build_hypergraph.

scale

Scaling method passed to node_degree.

degree_type

Degree measure(s) to display. One or both of:

  • "degree"

  • "weighted_degree"

graph_type

Hypergraph type(s) to display. Any combination of:

  • "redundant"

  • "synergistic"

  • "full"

style

Plot style.

"line"

Line plot.

"point"

Point plot.

"both"

Line and point plot.

orientation

Axis orientation.

"vertical"

Nodes on the x-axis.

"horizontal"

Nodes on the y-axis.

rotate_labels

Logical; rotate node labels to improve readability.

sort_nodes

Logical; if TRUE, nodes are ordered according to centrality values.

labels

Optional vector of node labels to display instead

Value

A ggplot2 object.

The returned object can be further customized using standard ggplot2 syntax.

Details

The function displays degree and weighted degree centrality for redundant, synergistic, and full hypergraphs using line plots, point plots, or a combination of both.

The plot compares node centrality across different hypergraph types and degree measures.

Two centrality measures are available:

  • Degree: number of significant hyperedges involving a node.

  • Weighted degree: sum of absolute O-information values across significant hyperedges involving a node.

When multiple graph types are selected, they are shown together using different colors.

Separate panels are created for each degree measure.

The resulting plot can be used to identify variables that participate most strongly in higher-order redundant or synergistic interactions.

Examples

if (FALSE) { # \dontrun{

# Default plot
plot_node_degree(hg)

# Weighted degree only
plot_node_degree(
  hg,
  degree_type = "weighted_degree"
)

# full hypergraph only
plot_node_degree(
  hg,
  graph_type = "full"
)

# Horizontal layout
plot_node_degree(
  hg,
  orientation = "horizontal"
)

# Sorted nodes
plot_node_degree(
  hg,
  sort_nodes = TRUE
)

} # }