Skip to contents

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.

Usage

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.

Author

Nathan S. Watson-Haigh

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