Learn R Programming

tnet (version 3.0.16)

clustering_w: Generalised clusering coefficient

Description

This function calculates the generalised clusering coefficient as proposed by Opsahl, T., Panzarasa, P., 2009. Clustering in weighted networks. Social Networks 31 (2), 155-163, doi: 10.1016/j.socnet.2009.02.002 Note: If you are having problems with this function (i.e., run out of memory or it being slow for simulations), there is a quicker and much more memory efficient c++ function. However, this function is not fully integrated in R, and requires a few extra steps. Send me an email to get the source-code and Windows-compiled files.

Usage

clustering_w(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 (default) gm implies the geometric mean method mi implies the minimum method ma implies the maximum method bi implies the binary measure This can be c("am", "gm", "mi", "ma", "bi") to calculate all.

Value

Returns the outcome of the equation presented in the paper for the method specific (measure)

References

Opsahl, T., Panzarasa, P., 2009. Clustering in weighted networks. Social Networks 31 (2), 155-163, doi: 10.1016/j.socnet.2009.02.002 http://toreopsahl.com/2009/04/03/article-clustering-in-weighted-networks/

Examples

Run this code
# NOT RUN {
## Generate a random graph
#density: 300/(100*99)=0.03030303; 
#this should be average from random samples
rg <- rg_w(nodes=100,arcs=300,weights=1:10)

## Run clustering function
clustering_w(rg)

# }

Run the code above in your browser using DataLab