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.
Examples
clusteringCoefficient(network_gen(50,.33)$network)
#> [1] 0.50000000 0.33333333 0.00000000 NaN 0.00000000 0.00000000
#> [7] NaN 0.50000000 0.00000000 NaN 0.33333333 0.08333333
#> [13] 0.00000000 0.15000000 0.16666667 -0.50000000 0.00000000 -0.50000000
#> [19] 0.00000000 0.00000000 0.00000000 NaN 0.50000000 NaN
#> [25] NaN 0.16666667 NaN 0.50000000 0.50000000 0.00000000
#> [31] NaN 0.50000000 0.04444444 NaN 0.16666667 0.00000000
#> [37] 0.00000000 0.16666667 0.06666667 NaN NaN 0.02380952
#> [43] 0.50000000 0.00000000 0.00000000 0.00000000 0.00000000 0.06666667
#> [49] NaN 0.50000000