as.directed {igraph} | R Documentation |
as.directed
converts an undirected graph to
directed, as.undirected
is the opposite, it converts a directed
graph to undirected.
as.directed(graph, mode = "mutual") as.undirected(graph, mode = "collapse")
graph |
The graph to convert. |
mode |
Character constant, defines the conversion algorithm. For
as.directed it can be mutual or arbitrary . For
as.undirected it can be each or collapse . See
details below. |
Conversion algorithms for as.directed
:
Conversion algorithms for as.undirected
:
A new graph object.
Gabor Csardi csardi@rmki.kfki.hu
simplify
for removing multiple and/or loop edges
from a graph.
g <- graph.ring(10) as.directed(g, "mutual") g2 <- graph.star(10) as.undirected(g)