View source: R/ui_plotting-topology.R
ggtopo.topology | R Documentation |
A quick plot using ggraph
## S3 method for class 'topology'
ggtopo(x, layout = "auto", edge = "fan", ...)
x |
A topology matrix. |
layout |
Optional, layout to use (e.g. "sugiyama", "kk", "stress") |
edge |
"curve" (the default), "line" or "fan". |
... |
Not used for now. |
A ggplot2 plot.
if (requireNamespace("ggraph")) {
z <- topo(aquarium_mod)
ggtopo(z)
ggtopo(z, edge = "line")
z <- topo(trini_mod)
ggtopo(z)
# For finer control, one can build a tbl_graph from the topology and
# use ggraph directly
x <- as_tbl_graph(z)
library(ggraph)
ggraph(x) + geom_edge_link()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.