getCommunityConnectedness {linkcomm}R Documentation

Calculate Community Connectedness or Modularity

Description

This function returns a measure of how relatively outwardly or inwardly connected a community is.

Usage

getCommunityConnectedness(x, clusterids = 1:x$numbers[3], conn = "conn", 
                          normalise = TRUE, verbose = FALSE)

Arguments

x

An object of class linkcomm.

clusterids

An integer vector of community IDs. Defaults to all communities.

conn

A character string naming the connectedness measure to use. Can be one of "conn" or "mod" (see Details below). Defaults to "conn".

normalise

Logical, whether to normalise community connectedness measures by the number of nodes in individual communities. Defaults to TRUE.

verbose

Logical, whether to display the progress of the calculation on the screen. Defaults to FALSE.

Details

The connectedness and modularity of different communities indicates whether a particular community is bridging several other communities, or existing as a relatively isolated module. The modularity of community i is

M_{i}=\left(\frac{e_{w}(i)}{n_{i}(n_{i}-1)/2}\right).\left(\frac{e_{b}(i)}{n_{i}\hat{d}}\right)^{-1}

where e_{w}(i) is the number of edges within community i, e_{b}(i) is the number of edges community i makes to other communities, n_{i} is the number of nodes in community i, and \hat{d} is the average degree in the network. Community connectedness is the inverse of this value.

Value

A named numerical vector, where the names are community IDs and the numbers are community connectedness or modularity scores.

Author(s)

Alex T. Kalinka alex.t.kalinka@gmail.com

References

Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27, 2011-2012.

See Also

getCommunityCentrality

Examples

## Generate graph and extract link communities.
g <- swiss[,3:4]
lc <- getLinkCommunities(g)

## Get community connectedness.
cc <- getCommunityConnectedness(lc, normalise = FALSE)

[Package linkcomm version 1.0-14 Index]