geom_edge | R Documentation |
layer to draw edges of a network
geom_edge(mapping = NULL, data = NULL, geom = geom_segment, ...)
mapping |
aesthetic mapping, default is NULL |
data |
data to plot, default is NULL |
geom |
geometric layer to draw lines |
... |
additional parameter passed to 'geom' |
line segments layer
flow_info <- data.frame(from = LETTERS[c(1,2,3,3,4,5,6)],
to = LETTERS[c(5,5,5,6,7,6,7)])
dd <- data.frame(
label = LETTERS[1:7],
v1 = abs(rnorm(7)),
v2 = abs(rnorm(7)),
v3 = abs(rnorm(7))
)
g = igraph::graph_from_data_frame(flow_info)
p <- ggplot(g) + geom_edge()
library(ggplot2)
library(scatterpie)
p %<+% dd +
geom_scatterpie(cols = c("v1", "v2", "v3")) +
geom_text(aes(label=label), nudge_y = .2) +
coord_fixed()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.