Description Usage Arguments Value Author(s) Examples
This function allows you to layer the edgeset of a
popgraph
object
1 | geom_edgeset(mapping = NULL, graph = NULL, directed = FALSE, ...)
|
mapping |
The aesthetic mapping as an |
graph |
The popgraph/igraph object to be plot |
directed |
A flag indicating that you should only plot the edge with the largest weight if more than one edge connects nodes. |
... |
Largely ignored. |
A formatted geom_segment object for addition to a ggplot()
Rodney J. Dyer <rjdyer@vcu.edu>
1 2 3 4 5 6 7 8 9 10 | a <- matrix( c(0,1,0,1,1,0,0,1,0,0,0,1,1,1,1,0),nrow=4)
rownames(a) <- colnames(a) <- LETTERS[1:4]
graph <- as.popgraph(a)
igraph::V(graph)$x <- runif(4)
igraph::V(graph)$y <- runif(4)
require(ggplot2)
ggplot() + geom_edgeset( aes(x=x,y=y), graph )
ggplot() + geom_edgeset( aes(x=x,y=y), graph, color="darkblue" )
require(grid)
ggplot() + geom_edgeset( aes(x=x,y=y), graph, directed=TRUE, arrow=arrow(length=unit(0.5,"cm")) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.