get_partitions: Gather a collection of community detection partitions...

View source: R/get_partitions.R

get_partitionsR Documentation

Gather a collection of community detection partitions (get_partitions)

Description

The get_partitions function is a wrapper to gather a collection of community detection partitions using igraph's cluster_leiden for maximizing modularity at various resolution parameter values, along with the routines called by the comm_detect function, to gather different partitions for subsequent input to the CHAMP code for post-processing partitions to identify domains of modularity optimization.

Usage

get_partitions(
  network,
  gamma_range = c(0, 3),
  n_runs = 100,
  n_iterations = 2,
  seed = NULL,
  add_comm_detect = TRUE
)

Arguments

network

The network, as igraph object, to be clustered into communities. Only undirected networks are currently supported. If the object has a 'weight' edge attribute, then that attribute will be used.

gamma_range

The range of the resolution parameter gamma (default from 0 to 4).

n_runs

The number of cluster_leiden runs to be attempted (default = 100).

n_iterations

Parameter to be passed to cluster_leiden (default = 2).

seed

Optional random seed for reproducing pseudo-random results.

add_comm_detect

Boolean to decide whether to also call the clustering algorithms included in comm_detect (default = T). Alternatively, the output of comm_detect can be provided directly here.

Value

get_partitions returns a list of unique partitions appropriate for subsequent input to CHAMP.

Author(s)

Peter J. Mucha (peter.j.mucha@dartmouth.edu), Alex Craig, Rachel Matthew, Sydney Rosenbaum and Ava Scharfstein

Examples

# Use get_partitions to generate multiple partitions of the
# Zachary karate club at different resolution parameters
data(karate, package = "igraphdata")
partitions <- get_partitions(karate, n_runs = 2500)

ideanet documentation built on June 8, 2025, 1:07 p.m.