View source: R/network_analysis.R
| compare_centralities | R Documentation |
Compare node centralities between two networks
compare_centralities(
x,
y,
measures = c("degree", "betweenness", "closeness"),
method = c("pearson", "spearman", "kendall"),
directed = NULL
)
x, y |
Supported network representations. |
measures |
Centralities passed to |
method |
Correlation method. |
directed |
Treat networks as directed. |
A tidy base data.frame with one row per measure and columns
measure, method, correlation, mae, and nodes. Nodes present in
only one network contribute a centrality of zero to the other.
correlation is NA when either set of centralities has no variance.
Requires the suggested igraph package.
a <- simulate_network(nodes = 30, model = "bernoulli", probability = 0.1, seed = 1)
b <- simulate_network(nodes = 30, model = "bernoulli", probability = 0.1, seed = 2)
if (requireNamespace("igraph", quietly = TRUE)) {
compare_centralities(a, b, measures = "degree")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.