Learn R Programming

NetworkToolbox (version 1.4.2)

diversity: Diversity Coefficient

Description

Computes the diversity coefficient for each node. The diversity coefficient measures a node's connections to communitites outside of its own community. Nodes that have many connections to other communities will have higher diversity coefficient values. Positive and negative signed weights for diversity coefficients are computed separately.

Usage

diversity(A, comm = c("walktrap", "louvain"))

Arguments

A

Network adjacency matrix

comm

A vector of corresponding to each item's community. Defaults to "walktrap" for the cluster_walktrap community detection algorithm. Set to "louvain" for the louvain community detection algorithm. Can also be set to user-specified communities (see examples)

Value

Returns a list containing:

overall

Diversity coefficient without signs considered

positive

Diversity coefficient with only positive sign

negative

Diversity coefficient with only negative sign

Details

Values closer to 1 suggest greater between-community connectivity and values closer to 0 suggest greater within-community connectivity

References

Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and interpretations. NeuroImage, 52, 1059-1069.

Examples

Run this code
# NOT RUN {
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A

#theoretical communities
comm <- rep(1:8, each = 6)

gdiv <- diversity(A, comm = comm)

#walktrap communities
wdiv <- diversity(A, comm = "walktrap")

# }

Run the code above in your browser using DataLab