Convert communities object to nodegroups list format
Source:R/jamenrich-communities-nodegroups.R
communities2nodegroups.RdConvert communities object to nodegroups list format
Arguments
- wc
communitiesobject as returned byigraphfunctions such ascluster_optimal(),cluster_walktrap(), orcluster_leading_eigen().Alternatively, a
listobject with 'membership' and 'names'.Alternatively, a
listobject which mimics the output of this function, in which case the inputwcis returned as-is.
- sep
characterstring, default ',' (comma), used when cluster_names are defined as alistwith vector of names for each cluster. Passed tojamba::cPaste().- ...
additional arguments are passed to
jamba::cPaste()when relevant.
Value
list of character vectors, where each vector contains
names of igraph nodes. When algorithm is defined in the
input object, it is included as an attribute of the output list,
accessible with attr(out, "algorithm").
When optional value "cluster_names" is present in the communities
object, they are used to define the output list names.
Details
Note that this function is "lossy", in that the output list
does not contain all the information necessary to reconstitute
the input communities object in detail. However, the output
list can be converted to a communities object that will
be accepted by most igraph related functions that require
that object type as an input value.
Alternatively, this function can be used to confirm the input
is already appropriate nodegroups list format, by supplying
list format upfront.
See also
Other jam igraph functions:
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(),
sync_igraph_communities()