Assign labels to igraph communities

label_communities(
  wc,
  labels = NULL,
  add_catchwords = NULL,
  num_keep_terms = 3,
  keep_terms_sep = ",\n",
  ...
)

Arguments

wc

communities object, or list in form of nodegroups, which is a list of character vectors that contain igraph node names.

labels

character vector of optional labels to assign directly to community clusters. When not defined, the auto-detection method is used.

add_catchwords

character of optional words to include as catchwords, to be excluded from use in the final label.

num_keep_terms

integer maximum number of terms to be included in the final output label, when auto-detection is used.

keep_terms_sep

character string used as a delimited to separate each term when multiple terms are concatenated together to form the cluster label.

...

additional arguments are ignored.

Value

communities or list format matching the input wc format.

  • When communities is input, additional value cluster_names will contain a character vector of names corresponding to each integer index in wc$membership.

  • When nodegroups is input, the list names will be a character vector of cluster labels.