network.dyadcount {network} | R Documentation |
network.dyadcount
returns the number of dyads within a network
, removing those flagged as missing if desired.
network.dyadcount(x, na.omit = TRUE)
x |
an object of class network |
na.omit |
logical; omit edges with na==TRUE from the count? |
The return value network.dyadcount
is equal to the number of dyads, minus the number of NULL
edges (and missing edges, if na.omit==TRUE
).
The number of dyads in the network
Mark S. Handcock handcock@stat.washington.edu
Butts, C.T. 2002. ``Memory Structures for Relational Data in R: Classes and Interfaces'' Working Paper.
#Create a network with three edges m<-matrix(0,3,3) m[1,2]<-1; m[2,3]<-1; m[3,1]<-1 g<-network(m) network.dyadcount(g)==6 #Verify the dyad count g<-network(m|t(m),directed=FALSE) network.dyadcount(g)==3 #nC2 in undirected case