EdgelistFromIgraph {dils} | R Documentation |
Given an igraph object for a network return a data.frame listing all possible edges and the weights for each edge.
EdgelistFromIgraph(g, useWeight = FALSE)
g |
igraph, from igraph package. |
useWeight |
logical, Should E(g)$weight be used as the weights for the edges? |
This function is preferred to the igraph function
get.edgelist
because get.edgelist
only
returns rows for edges that have non-zero weight and does
not return weights, if present.
data.frame, full list of all possible edges with weights for each in third column.
Stephen R. Haptonstahl srh@haptonstahl.org
https://github.com/shaptonstahl/
g <- erdos.renyi.game(10, 2/10) EdgelistFromIgraph(g) V(g)$name <- letters[1:vcount(g)] EdgelistFromIgraph(g) E(g)$weight <- runif(ecount(g)) EdgelistFromIgraph(g, useWeight=TRUE)