| cluster_louvain_graph | R Documentation |
Graph community detection using igraph::cluster_louvain.
cluster_louvain_graph(weights = NULL)
weights |
optional edge weights to pass to |
Accepts an igraph object and returns community memberships.
Requires the igraph package.
returns a Louvain clustering object.
Blondel, V. D., Guillaume, J.-L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of communities in large networks. J. Statistical Mechanics.
if (requireNamespace("igraph", quietly = TRUE)) {
g <- igraph::sample_gnp(n = 20, p = 0.15)
model <- cluster_louvain_graph()
model <- fit(model, g)
clu <- cluster(model, g)
table(clu)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.