Description Usage Arguments Value Note Author(s) References Examples
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 defines the triplet value as the average of the two tie weights; however it can also define it differently. See the blog post.
Note: If there are very large tie weights in a network, the geometric method in R fails. However, this can be fixed by transforming the values.
net[,"w"] <- (net[,"w"]/min(net[,"w"]))
This step is not required unless you receive warnings when running the function.
1 | clustering_local_w(net, measure = "am")
|
net |
A weighted edgelist |
measure |
The measure-switch control the method used to calculate the value of the triplets. |
Returns a data.frame with at least two columns: the first column contains the nodes' ids, and the remaining columns contain the corresponding clustering scores.
version 1.0.0
Tore Opsahl; http://toreopsahl.com
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/
1 2 3 4 5 6 7 | ## 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,directed=FALSE)
## Run clustering function
clustering_local_w(rg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.