Converts various network representations to an igraph object. Supports
matrices, edge-list data frames, igraph objects, network objects,
cograph_network, and tna objects.
Usage
to_igraph(x, directed = NULL)
Value
An igraph object.
Arguments
x
Network input. Can be:
A square numeric matrix (adjacency/weight matrix)
A data frame edge list with source and target columns
An igraph object (returned as-is or converted if directed differs)
A statnet network object
A cograph_network object
A tna object
directed
Logical or NULL. If NULL (default), auto-detect from matrix
symmetry. Set TRUE to force directed, FALSE to force undirected.