powered by
Graph community detection using igraph::cluster_louvain.
igraph::cluster_louvain
cluster_louvain_graph(weights = NULL)
returns a Louvain clustering object.
optional edge weights to pass to cluster_louvain
cluster_louvain
Accepts an igraph object and returns community memberships. Requires the igraph package.
igraph
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) }
Run the code above in your browser using DataLab