Description Usage Arguments Details Value Author(s) Examples
View source: R/reverseEdgeDirections.R
Return a new directed graph instance with each edge oriented in the opposite direction relative to the corresponding edge in the input graph.
1 |
g |
A |
WARNING: this doesn't handle edge attributes properly. It is a preliminary implementation and subject to change.
A graphNEL
instance
S. Falcon
1 2 3 4 5 6 7 8 9 10 | g <- graphNEL(nodes=c("a", "b", "c"),
edgeL=list(a=c("b", "c"), b=character(0), c=character(0)),
edgemode="directed")
stopifnot(isAdjacent(g, "a", "b"))
stopifnot(!isAdjacent(g, "b", "a"))
grev <- reverseEdgeDirections(g)
stopifnot(!isAdjacent(grev, "a", "b"))
stopifnot(isAdjacent(grev, "b", "a"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.