Description Usage Arguments Details Value
Aggregate nodes in given communities into 'super-nodes' that represent those communities, and combine any associated inter- or intra-community links.
1 2 3 4 5 6 7 | merge_communities(x, communities)
## Default S3 method:
merge_communities(x, communities)
## S3 method for class 'igraph'
merge_communities(x, communities)
|
x |
a matrix of citations (from columns to rows) or an igraph object |
communities |
A numeric vector that specifies the mapping, or a communities object. Its elements correspond to the vertices, and for each element the id in the new graph is given. |
Any matrix-like x
argument will be coerced to a dgCMatrix
.
A sparse matrix, representing a contingency table of edges from communities to nodes.
While it would be nice to return an igraph object when given an x
of that class,
the process of aggregating the 'from' nodes while preserving 'to' nodes would mean coercing
the directed graph to an undirected bipartite graph, then contracting vertices in one mode
and not the other. This may be difficult to implement, so for the time-being we simply convert
igraph objects to weighted adjacency matrices and then pass to merge_communities.default
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.