my_union_graph: Union of graphs

Description Usage Arguments Value Author(s) Examples

Description

Performs union of multiple graphs, internally controlling for possible common nodes

Usage

1

Arguments

...

igraph-class graphs to be joined

Value

Returns (invisibly) a new igraph-class graph that is a union and/or disjoint union of the input graphs

Author(s)

J Bedia

Examples

 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)

Predictia/metaclipR documentation built on May 14, 2019, 6:07 a.m.