Description Usage Arguments Examples
This function allows you to detect how many communities are in the graph and to which community each node and edge belongs.
1 2 3 4 5 6 7 8 9 10 11 12 | graph.communities(
x,
algorithm = c("louvain", "edge.betweenness", "fast.greedy", "label.prop",
"leading.eigen", "optimal", "spinglass", "walktrap"),
network = TRUE,
network.layout = c("circle", "star", "grid", "sphere", "nicely"),
interactive.network = FALSE,
network.isolated = TRUE,
dendrogram = FALSE,
dendrogram.type = c("fan", "phylogram", "cladogram", "unrooted", "radial"),
from = c("auto", "adjacency", "edges", "graph", "igraph", "bnlearn")
)
|
x |
Graph object. |
algorithm |
Algorithm for finding communities: 'louvain', 'edge.betweenness', 'fast.greedy', 'label.prop', 'leading.eigen', 'optimal', 'spinglass', or 'walktrap'. Default: 'louvain' |
network |
Whether or not to plot the network. Default: TRUE |
network.layout |
igraph network layout (optional): 'grid', 'star', 'circle', 'sphere', or 'nicely'. Default: 'circle' |
interactive.network |
Interactive network (optional). Default: FALSE |
network.isolated |
Whether or not to include isolated nodes in the plot (optional). Default: TRUE |
dendrogram |
Whether or not to plot a dendrogram (when possible). Default: FALSE |
dendrogram.type |
Type of phylogeny to be drawn: 'fan', 'phylogram', 'cladogram', 'unrooted', or 'radial'. Default: 'fan' |
from |
Input format (optional). |
1 2 3 | communities <- graph.communities(g)
communities <- graph.communities(g, algorithm='louvain', network=TRUE, network.isolated=FALSE, dendrogram=FALSE)
communities <- graph.communities(g, algorithm='walktrap', network=FALSE, dendrogram=TRUE, dendrogram.type='cladogram')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.