network.density computes the density of its argument.
Usage
network.density(x)
Arguments
x
an object of class network
Value
The network density.
Details
The density of a network is defined as the ratio of extant edges to potential edges. We do not currently consider edge values; missing edges are automatically omitted.
References
Wasserman, S. and Faust, K. 1994. Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
#Create an arbitrary adjacency matrixm<-matrix(rbinom(25,1,0.5),5,5)
diag(m)<-0g<-network.initialize(5) #Initialize the networknetwork.density(g) #Calculate the density