Description Usage Arguments Value Author(s) Examples
Performs union of multiple graphs, internally controlling for possible common nodes
1 |
... |
igraph-class graphs to be joined |
Returns (invisibly) a new igraph-class graph that is a union and/or disjoint union of the input graphs
J Bedia
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | require(igraph)
# A disjoint union
g1 <- make_graph(c("1", "2", "2", "3", "3", "4", "4", "5", "4", "6"), directed = TRUE)
plot(g1)
g2 <- make_graph(c("7", "8", "8", "9", "9", "10", "9", "11"), directed = TRUE)
plot(g2)
g <- my_union_graph(g1, g2)
plot(g)
# A union of multiple graphs (one disjoint, two connected)
g3 <- make_graph(c("11", "10", "11", "12", "12", "13"), directed = TRUE)
plot(g3)
g <- my_union_graph(g1, g2, g3)
plot(g)
# A complete union of graphs
g4 <- make_graph(c("11", "1", "11", "10", "11", "12", "12", "13", "3", "12"), directed = TRUE)
g <- my_union_graph(g1, g2, g3, g4)
plot(g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.