Extract communities using the walktrap algorithm

extract_comm_walktrap(
  x,
  weights = NA,
  steps = 4,
  modularity = TRUE,
  merges = TRUE,
  membership = TRUE
)

Arguments

x

The input graph, edge directions are ignored in directed graphs.

weights

The weights of the edges. It must be a positive numeric vector, NULL or NA. If it is NULL and the input graph has a ‘weight’ edge attribute, then that attribute will be used. If NULL and no such attribute is present, then the edges will have equal weights. Set this to NA if the graph was a ‘weight’ edge attribute, but you don't want to use it for community detection. Larger edge weights increase the probability that an edge is selected by the random walker. In other words, larger edge weights correspond to stronger connections.

steps

The length of the random walks to perform.

modularity

Logical scalar, whether to include the vector of the modularity scores in the result. If the membership argument is TRUE, then it will always be calculated.

merges

Logical scalar, whether to include the merge matrix in the result.

membership

Logical scalar, whether to calculate the membership vector for the split corresponding to the highest modularity value.

Value

a communities object

Details

Find community structure in the graph by using random walks across the edges of the graph. The idea is that short random walks tend to stay in the same community.

The result of this function can be queried using the utility functions documented here: membership,

References

this function just wraps the cluster_walktrap function and documentation.