Hello,
I'm using graph.union.by.name in R to merge graphs with overlapping vertex
symbolic names.  The original graphs also have edge weights, and the way I
made them is such that the edge between any two vertices with matching
symbolic names will always have identical edge weights.  Is there any way,
after running the union, to add back in the weights?  e.g.

g3 <- graph.union.by.name(g1, g2)

I thought of using match in R to identify matching edges thus:

m1 <- match(E(g3), E(g1))
m2 <- match(E(g3), E(g2))

and then using:

E(g3)$weight[m1] <- E(g1)$weight
E(g3)$weight[m2] <- E(g2)$weight

but this fails as match seems to be using the updated edge IDS in the
merged dataset (as expected, I guess).


any suggestions would be most welcome

thanks
Tony
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to