Calculate the clustering coefficient for an adjacency matrix. By default, the local clustering coefficient is calculated. From the PCIT package after it was archived on the CRAN.

clusteringCoefficient(adj, FUN = "localClusteringCoefficient", ...)

Arguments

adj

An adjacency matrix. Calculating the clustering coefficient only makes sense if some connections are zero i.e. no connection.

FUN

The function for calculating the clustering coefficient.

...

Arguments to pass to FUN

Value

The clustering coefficient(s) for the adjacency matrix.

See also

Author

Nathan S. Watson-Haigh

Examples

clusteringCoefficient(network_gen(50,.33)$network)
#> [1] NaN NaN 0.50000000 0.00000000 0.06666667 0.00000000 #> [7] NaN NaN 0.00000000 NaN 0.02380952 0.00000000 #> [13] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 -0.50000000 #> [19] NaN 0.33333333 0.10000000 0.05000000 NaN 0.00000000 #> [25] 0.50000000 0.50000000 0.50000000 0.00000000 0.50000000 0.00000000 #> [31] 0.00000000 0.00000000 NaN 0.00000000 0.00000000 -0.16666667 #> [37] 0.16666667 NaN 0.08333333 0.00000000 0.00000000 -0.50000000 #> [43] 0.00000000 NaN -0.50000000 0.00000000 NaN 0.00000000 #> [49] NaN 0.00000000