Sync igraph nodes and communities
Source:R/jamenrich-communities-nodegroups.R
sync_igraph_communities.RdSync igraph nodes and communities
Arguments
- g
igraphobject- wc
communitiesobject, orlistin form of nodegroups, which is alistofcharactervectors that containigraphnode names.- verbose
logicalindicating whether to print verbose output.- ...
additional arguments are passed to
nodegroups2communities()only when inputwcis supplied inlistnodegroups format.
Value
list with two elements:
"g"- theigraphobject after subsetting to match node names shared withwc, as necessary."wc'- thecommunitiesobject after subsetting to match node names shared withg, as necessary. When inputwcis inlistnodegroups format, that same format is returned.
Details
This function ensures that igraph nodes and corresponding
community clusters are synchronized for proper downstream use.
In particular, when using a subgraph, or when communities only
assign a subset of nodes to clusters, this function ensures the
two objects are in sync, the same order, and with the same nodes.
See also
Other jam igraph functions:
communities2nodegroups(),
drawEllipse(),
edge_bundle_bipartite(),
edge_bundle_nodegroups(),
fixSetLabels(),
flip_edges(),
get_bipartite_nodeset(),
highlight_edges_by_node(),
igraph2pieGraph(),
label_communities(),
mem2cnet(),
mem2emap(),
nodegroups2communities(),
rectifyPiegraph(),
removeIgraphBlanks(),
subsetCnetIgraph(),
subset_igraph_components()