powered by
Compares two community structures using various similarity measures.
compare_communities( comm1, comm2, method = c("vi", "nmi", "split.join", "rand", "adjusted.rand") )
Numeric similarity/distance value
First community structure (communities object or membership vector)
Second community structure (communities object or membership vector)
Comparison method: "vi" (variation of information), "nmi" (normalized mutual information), "split.join", "rand" (Rand index), "adjusted.rand"
if (requireNamespace("igraph", quietly = TRUE)) { g <- igraph::make_graph("Zachary") c1 <- community_louvain(g) c2 <- community_leiden(g) compare_communities(c1, c2, "nmi") }
Run the code above in your browser using DataLab