Learn R Programming

tnet (version 0.1.2)

clustering_w_barrat: Barrat et al. (2004) generalised local clusering coefficient

Description

This function calculates Barrat et al. (2004) generalised local clusering coefficient. See http://toreopsahl.com/2009/01/23/weighted-local-clustering-coefficient/ for a detailed description. By default it measure the triplet value as the average of the two ties; however it can also define it differently. See the blog post.

Usage

clustering_w_barrat(net, measure = "am")

Arguments

net
A weighted edgelist
measure
The measure-switch control the method used to calculate the value of the triplets. am implies the arithmetic mean method gm implies the geometric mean method mi implies the minimum method ma implies the maximum method This can be c("am", "gm", "mi", "ma")

Value

  • Returns a data.frame with at least two columns: the first containts the node ids of all the nodes in the edgelist, and the remaining ones containt the corresponding clustering scores.

References

Barrat, A., Barthelemy, M., Pastor-Satorras, R., Vespignani, A., 2004. The architecture of complex weighted networks. Proceedings of the National Academy of Sciences 101 (11), 3747-3752. arXiv:cond-mat/0311416 http://toreopsahl.com/2009/01/23/weighted-local-clustering-coefficient/

Examples

Run this code
## Generate a random graph
#density: 300/(100*99)=0.03030303; 
#this should be average from random samples
rg <- rg_w(nodes=100,arcs=300,max.weight=10,directed=FALSE)

## Run clustering function
clustering_w_barrat(rg)

Run the code above in your browser using DataLab