ccoeff {gRapHD}R Documentation

Clustering coefficient.

Description

Returns the clustering coefficients of the nodes in a graph.

Usage

  ccoeff(model=NULL,edges=NULL,p=NULL)

Arguments

model gRapHD object.
edges matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge. Column 1 contains the vertex with lower index.
p number of vertices. If NULL, the p=max(edges).

Details

The clustering coefficient is given by C_i=2*e_i/(k_i*(k_i-1)), where k_i is the number of neighbours the vertex i has, and e_i is the number of edges between the neighbours of i.

Value

A vector with length p with the clustering coefficient of each vertex.

Author(s)

Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)

Examples

  data(dsCont)
  m <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="BIC")
  m1 <- stepw(m,dsCont)
  cc <- ccoeff(edges=m1$edges,p=m1$p)
  mean(cc)

[Package gRapHD version 0.1.0 Index]