Merges two graphs maintaining whilst thier attributes.

union2(g1, g2)

Arguments

g1

Igraph object

g2

Igraph object

Value

A new graph object

Details

This function is an upgrade to the igraph function "union". It creates the union of two networks, and merges attributes with the same name. In the original union the graph attributes were lost. In the case where there are overlapping nodes the attributes of g1 take precedence

See also

Examples

union2(g1,g2)
#> Error in "igraph" %in% class(graph): object 'g1' not found
Reduce(union2, list(g1,g2,g3))
#> Error in Reduce(union2, list(g1, g2, g3)): object 'g1' not found