View source: R/ClusteringCoefficient.R
| clusteringCoefficient | R Documentation |
A function to calculate the clustering coefficient for all nodes in a network.
clusteringCoefficient(A, directed = T)
A |
an adjacency |
directed |
|
This function calculates the inward and outward clustering coefficient in directed networks [1].
If directed = TRUE, a data.frame. The first column,
$clustering.in, is the inward clustering coefficient,
$clustering.out, is the outward clustering coefficient.
If directed = FALSE, a vector, with the undirected clustering coefficient.
[1] Caldarelli G (2007). Scale-Free Networks. Oxford University Press, Oxford.
# Generate an arbitrary 100 by 100 adjacency matrix with zeros and ones
# Remove loops
A <- matrix(rbinom(100 * 100, 1, 0.2), ncol = 100, nrow = 100)
diag(A) <- 0
# call contact chain function
cc <- clusteringCoefficient(A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.