"as.edgelist"(x, attrname = NULL, as.sna.edgelist = FALSE, inverted = NULL, ...) "as.edgelist"(x, n, directed = TRUE, bipartite = FALSE, loops = FALSE, inverted = FALSE, vnames = seq_len(n), ...) is.edgelist(x)network object with additional class added indicating how it should be dispatched.
edgelist.The edgelist has additional attributes attached to it:
attr(,"n") the number of vertices in the original networkattr(,"vnames") the names of vertices in the original networkattr(,"directed") logical, was the original network directedattr(,"bipartite") was the original network bipartiteattr(,"loops") does the original network contain self-loopsattr(,"inverted") indicates if the network has been inverted?
attrname attribute is used the resulting edgelist matrix will have three columns. And if attrname refers to a character attribute, the resulting edgelist matrix will be character rather than numeric.ergm)
The as.matrix.network.edgelist provides similar functionality but it does not enforce ordering or set the edgelist class and so should be slightly faster.
is.edgelist tests if an object has the class 'edgelist'
as.matrix.network.edgelist
data(emon)
as.edgelist(emon[[1]])
# contrast with unsorted columns of
as.matrix.network.edgelist(emon[[1]])
Run the code above in your browser using DataLab