| as.edgelist {ergm} | R Documentation |
Constructs an edgelist in the format expected by ergm's internal functions
## S3 method for class 'network'
as.edgelist(x, attrname = NULL, as.sna.edgelist = FALSE,
inverted = NULL, ...)
## S3 method for class 'matrix'
as.edgelist(x, n, directed = TRUE, bipartite = FALSE,
loops = FALSE, inverted = FALSE, ...)
x |
a |
attrname |
optionally, the name of an edge attribute to use for edge values |
as.sna.edgelist |
logical; should the edgelist be returned in edgelist form expected by the sna package? |
inverted |
logical; value is passed to the 'inverted' flag on the edgelist returned |
n |
integer number of vertices in network, value passed to the 'n' flag on edgelist returned |
directed |
logical; is network directed, value passed to the 'directed' flag on edgelist returned |
bipartite |
logical or integer; is network bipartite, value passed to the 'bipartite' flag on edgelist returned |
loops |
logical; are self-loops allowed in network?, value passed to the 'loops' flag on edgelist returned |
... |
additional arguments to other methods |
Constructs an edgelist matrix from a network, sorted tails-major order, with tails first, and, for undirected networks, tail < head.
The as.matrix.network(nw, matrix.type="edgelist") provides similar functionality but it does not enforce ordering..
a two-column matrix of integers giving the tail (source) and head (target) indices of each edge. The edgelist has additional attributes attached to it
attr(,"n") the number of vertices in the original network
attr(,"directed") logical, was the original network directed
attr(,"bipartite") was the original network bipartite
attr(,"loops") does the original network contain self-loops
attr(,"inverted") indicates if the network has been inverted?
NOTE THAT THIS FUNCTION WILL PROBABLY BE TRANSFERED TO THE network PACKAGE IN THE NEAR FUTURE
See also as.matrix.network.edgelist
data(faux.mesa.high) as.edgelist(faux.mesa.high)