network.edgecount {network} | R Documentation |
network.edgecount
returns the number of edges within a network
, removing those flagged as missing if desired.
network.edgecount(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.edgecount
is equal to g$gal$mnext
-1, minus the number of NULL
edges (and missing edges, if na.omit==TRUE
). Note that g$gal$mnext
-1 cannot, by itself, be counted upon to be an accurate count of the number of edges!
The number of edges
Carter T. Butts buttsc@uci.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.edgecount(g)==3 #Verify the edgecount