Convert nodegroups list to communities object
Source:R/jamenrich-communities-nodegroups.R
nodegroups2communities.RdConvert nodegroups list to communities object
Arguments
- algorithm
characterorNULL, indicating the name of the community detection algorithm used.When
algorithmis defined, it is used instead ofattr(nodegroups, "algorithm").When
algorithmisNULL,attribute(nodegroups, "algorithm")is used if defined, otherwisealgorithm="nodegroups".
- ...
additional arguments are ignored.
- wc
communitiesobject as returned byigraphfunctions such ascluster_optimal(),cluster_walktrap(), orcluster_leading_eigen().
Value
community object, which is essentially a list with
specific required elements:
"membership"-integerassignment of nodes to clusters"names"-characterlist of node names"vcount"-integernumber of nodes"algorithm"-characterstring with the name of the community detection method used."cluster_names"-characterlabels associated withmembershipindex values. These names are not generated byigraphcommunity detection, and are therefore optional for use in mostigraphworkflows. However, they are used in somemultienrichjamfunctions, specificallymake_point_hull()which optionally displays a label beside each node cluster during plotting.
Details
Note that this function is "lossy", in that the output communities
object will not contain any supporting data specific to the
community detection algorithm originally used.
However, the output communities object will be accepted
by most igraph related functions that require
that object type as an input value.
The names(nodegroups) are used to define a new element in the
output communities object "cluster_names", so the names
will be maintained in the data. Default igraph functions
do not use these names, but they are used by multienrichjam
for example by function make_point_hull() which uses these
names to label each cluster during plotting.
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(),
rectifyPiegraph(),
removeIgraphBlanks(),
subsetCnetIgraph(),
subset_igraph_components(),
sync_igraph_communities()