summarize_networks: Summarize multiple networks

View source: R/network_analysis.R

summarize_networksR Documentation

Summarize multiple networks

Description

Summarize multiple networks

Usage

summarize_networks(networks, threshold = 0, directed = TRUE)

Arguments

networks

Named list of supported networks. Unnamed elements are labeled ⁠Network 1⁠, ⁠Network 2⁠, and so on.

threshold

Edge-presence threshold, applied as abs(weight) > threshold. It affects the edges and mean_weight columns only; density and components are computed from every edge in the network, thresholded or not.

directed

Treat networks as directed. density is the directed edge density when TRUE; components always counts weakly connected components.

Value

A tidy base data.frame with one row per network and columns network, nodes, edges, density, mean_weight, and components. mean_weight is NA when no edge passes the threshold. Requires the suggested igraph package.

Examples

networks <- list(
  first = simulate_network(nodes = 25, model = "bernoulli", probability = 0.1, seed = 1),
  second = simulate_network(nodes = 25, model = "bernoulli", probability = 0.2, seed = 2)
)
if (requireNamespace("igraph", quietly = TRUE)) {
  summarize_networks(networks)
}

simulab documentation built on Oct. 15, 2026, 5:08 p.m.