IgraphFromEdgelist: Convert an edgelist to an igraph
Description
Given the adjacency matrix for a network return a
data.frame listing all possible edges and the weights for
each edge.
Usage
IgraphFromEdgelist(elist, directed = TRUE)
Arguments
elist
data.frame, see 'Details' for formatting
assumptions.
directed
logical, If TRUE, the returned igraph is
directed.
Value
igraph, If the edgelist third column has values other
than 0, 1 then the weights are stored in E(returned
graph)$weight.
Details
This assumes that elist is a data.frame with three
columns. Each row is an edge in the network. The first
column lists the node the edge is coming from, the second
column lists the node the edge is going to, and the third
column lists the weight of the edge.