calc_modularity: Calculation of Modularity for a list of igraph objects

View source: R/calcTopologicalIndices.r

calc_modularityR Documentation

Calculation of Modularity for a list of igraph objects

Description

The function calculates modularity of the list of networks in the nullDist parameter. Modularity is calculated using the igraph::cluster_spinglass() Only works for one component networks.

Usage

calc_modularity(ig, ncores = 0, weights = NA)

Arguments

ig

list of igraph objects to calculate modularity

ncores

number of cores used to compute in parallel, if 0 sequential processing is used.

weights

The weights of the edges. Either a numeric vector or NULL or NA. If it is null and the input graph has a ‘weight’ edge attribute then that 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.

Value

a data.frame with the field Modularity

Examples

## Not run: 
nullg <- generateERbasal(netData[[1]],10)
calc_modularity(nullg)

## End(Not run)


lsaravia/EcoNetwork documentation built on March 20, 2024, 3:27 p.m.