LinkDensities: Calculate Link Community Link Densities
Description
This function calculates link densities for link communities.
Usage
LinkDensities(x, clusterids = 1:x$numbers[3])
Arguments
x
An object of class linkcomm.
clusterids
An integer vector of community IDs. Defaults to all communities.
Value
A named numerical vector, where the names are community IDs and the numbers are link densities.
Details
The link density of community i is
$$D_{i}=\frac{e_{i}-n_{i}+1}{(n_{i}(n_{i}-1)/2)-n_{i}+1}$$
where \(e_{i}\) is the number of edges in community i and \(n_{i}\) is the number of nodes in community i.
References
Ahn, Y.Y., Bagrow, J.P., and Lehmann, S. (2010). Link communities reveal multiscale complexity in networks. Nature466, 761-764.
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. Bioinformatics27, 2011-2012.
# NOT RUN {## Generate graph and extract link communities.g <- swiss[,3:4]
lc <- getLinkCommunities(g)
## Calculate link densities.ld <- LinkDensities(lc)
# }