View source: R/wrangle-structure.R
| reverse_edges | R Documentation |
Transposes the weight matrix, so every arc runs the other way. TNA users reach for this to look at where transitions came from rather than where they went.
reverse_edges(x, keep_format = FALSE, directed = NULL)
x |
Network input. |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A cograph_network with every edge reversed, or the input
format when keep_format = TRUE. An undirected network is returned
unchanged, with a cograph_no_effect warning.
to_directed, to_undirected
adj <- matrix(c(0, .5, 0,
0, 0, .7,
0, 0, 0), 3, 3, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
reverse_edges(adj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.