Summarize multiple networks
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 theedgesandmean_weightcolumns only;densityandcomponentsare computed from every edge in the network, thresholded or not.- directed
Treat networks as directed.
densityis the directed edge density whenTRUE;componentsalways 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)
}
#> network nodes edges density mean_weight components
#> first first 25 63 0.1050000 1 1
#> second second 25 130 0.2166667 1 1