[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] adding weights after graph.union.by.name
From: |
Tony Larson |
Subject: |
[igraph] adding weights after graph.union.by.name |
Date: |
Wed, 24 Oct 2012 17:26:03 +0100 |
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.
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] adding weights after graph.union.by.name,
Tony Larson <=
- Re: [igraph] adding weights after graph.union.by.name, Giorgos Bontzios, 2012/10/25
- Re: [igraph] adding weights after graph.union.by.name, Gábor Csárdi, 2012/10/31
- [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Tony Larson, 2012/10/31
- Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Gábor Csárdi, 2012/10/31
- Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Gábor Csárdi, 2012/10/31
- Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Tony Larson, 2012/10/31
- Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Gábor Csárdi, 2012/10/31
- Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges, Gábor Csárdi, 2012/10/31