View source: R/network-utils.R
| detect_communities | R Documentation |
Detects communities (clusters) in a network using various community detection algorithms. Returns a data frame with node-community assignments.
detect_communities(x, method = "louvain", directed = NULL, weights = TRUE)
x |
Network input: matrix, igraph, network, cograph_network, or tna object. |
method |
Community detection algorithm to use. One of:
|
directed |
Logical or NULL. If NULL (default), auto-detect from matrix symmetry. Set TRUE to force directed, FALSE to force undirected. |
weights |
Logical. Use edge weights for community detection. Default TRUE. |
A cograph_communities object, which inherits from
data.frame and has one row per node with columns:
node: Node labels/names
community: Numeric community membership
The algorithm name, the igraph community object, the modularity and the
input network are carried as attributes for the print, plot
and modularity methods.
detect_communities(regulation_net, method = "walktrap")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.