summarize_network: Summarize Network by Clusters

View source: R/cluster-metrics.R

summarize_networkR Documentation

Summarize Network by Clusters

Description

Creates a summary network where each cluster becomes a single node. Edge weights are aggregated from the original network using the specified method, without normalization.

Usage

summarize_network(
  x,
  cluster_list = NULL,
  method = c("sum", "mean", "max", "min", "median", "density", "geomean"),
  directed = TRUE
)

cnet(
  x,
  cluster_list = NULL,
  method = c("sum", "mean", "max", "min", "median", "density", "geomean"),
  directed = TRUE
)

Arguments

x

A weight matrix, tna object, or cograph_network.

cluster_list

Cluster specification:

  • Named list of node vectors (e.g., list(A = c("n1", "n2"), B = c("n3", "n4")))

  • A membership vector or a data frame, as in csum

  • A single string naming a column of the node table of a cograph_network (e.g., "clusters", "groups")

  • NULL (default) to use the first node column named "clusters", "cluster", "groups", "group", "community" or "module" of a cograph_network, with a message naming the column

method

Aggregation method for edge weights: "sum", "mean", "max", "min", "median", "density", "geomean". Default "sum".

directed

Logical. Whether the summary network is directed. Default TRUE.

Value

A cograph_network object with one node per cluster, labelled by cluster name. The edge weights are the aggregated between-cluster weights, and the diagonal holds the aggregated within-cluster weights. The node table has a size column with the number of original nodes in each cluster.

See Also

csum, plot_mcml

Examples

clusters <- list(C1 = c("Explore", "Reflect", "Discuss"),
                 C2 = c("Plan", "Create", "Share"),
                 C3 = c("Monitor", "Adapt", "Synthesize", "Evaluate"))
summarize_network(regulation_net, cluster_list = clusters)

cograph documentation built on Nov. 19, 2026, 5:07 p.m.