| standardize.network {ergm} | R Documentation |
Create a copy of a network of interest with certain guarantees about its internal representation:
for every edge, the id of the 'tails' vertex is < id of the 'heads' vertex
no (tail,head) id pair has more than one edge ID associated with it (no multiplex edges)
standardize.network(nw, preserve.eattr = TRUE)
nw |
a |
preserve.eattr |
logical; should the edge attributes be preserved during the copying process (presumably slower) |
This function is needed because the network object can support added non-directed edges in arbitrary order, as well as multiplex edges and hypergraphs (even if the network is not marked as such), which are not supported in the underlying ergm processes. Uses as.edgelist internally to make the conversion.
returns an ergm-appropriate network object.
This function may be time expensive. Also, the transformation is performed by deleting edges in initial network and re-adding them.
test<-network.initialize(5,directed=FALSE) test[2,1]<-1 #ergm wont like this test$mel[[1]] # peek at internal representation test2<-standardize.network(test) # enforce! test2$mel[[2]] # 1 and 2 have traded places