methodCommunity: methodCommunity

View source: R/ROBIN.R

methodCommunityR Documentation

methodCommunity

Description

This function detects the community structure of a graph. To detect the community structure the user can choose one of the methods implemented in igraph.

Usage

methodCommunity(
  graph,
  method = c("walktrap", "edgeBetweenness", "fastGreedy", "louvain", "spinglass",
    "leadingEigen", "labelProp", "infomap", "optimal", "leiden", "other"),
  leiden_objective_function = c("modularity", "CPM"),
  ...,
  FUN = NULL,
  verbose = FALSE
)

Arguments

graph

The output of prepGraph.

method

The clustering method, one of "walktrap", "edgeBetweenness", "fastGreedy", "louvain", "spinglass", "leadingEigen", "labelProp", "infomap", "optimal", "leiden","other".

leiden_objective_function

objective_function parameter for leiden only for method

...

additional parameters to use with any of the previous described methods (see igraph package community detection methods for more details i.e. cluster_walktrap)

FUN

in case the @method parameter is "other" there is the possibility to use a personal function passing its name through this parameter. The personal parameter has to take as input the @graph and the @weights (that can be NULL), and has to return a community object.

verbose

flag for verbose output (default as FALSE)

Value

A Communities object.

Examples

my_file <- system.file("example/football.gml", package="robin")
graph <- prepGraph(file=my_file, file.format="gml")
methodCommunity (graph=graph, method="louvain") 

robin documentation built on April 4, 2025, 6:08 a.m.