Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/EdgelistFromIgraph.R
Given an igraph object for a network return a data.frame listing all possible edges and the weights for each edge.
1 | 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/
1 2 3 4 5 6 7 8 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.