| ggflow | R Documentation |
Draw a flow chart from edge data
ggflow(
data,
layout = igraph::layout_as_tree,
start_shave = 0.3,
end_shave = 0.3,
type_shave = "proportion",
...
)
data |
a data frame with 'from' and 'to' columns, or an igraph object |
layout |
network layout passed to |
start_shave |
amount removed from the start of each edge |
end_shave |
amount removed from the end of each edge, before the arrowhead |
type_shave |
whether shaving is a proportion of edge length or a distance |
... |
additional parameters passed to |
ggflow() is a thin wrapper around ggplot.igraph() and geom_edge()
for from/to edge lists. It used to live in the standalone ggflow
package, which is now retired: flow charts are directed graphs, not trees,
so they belong here rather than in ggtreeDendro.
a ggplot object
Guangchuang Yu
library(ggtangle)
d <- data.frame(
from = c("A", "A", "A", "B", "C", "F"),
to = c("B", "C", "D", "E", "F", "G")
)
ggflow(d, arrow = arrow(type = 'closed')) +
ggfun::geom_scatter_rect(fill = NA, color = 'black') +
geom_text(aes(label = label), size = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.