I have multiple graphs on the same population, all of which have an edge weight of 1. I would like to take a union of these graphs, and have the final edge weight be the sum of each individual edge. ex) if A -> B in bl_G09 and bl_G24, I’d like the edge weight to be 2. However, when I query E(bl_pers_receive())$weight_i
, NULL
is returned. Is there a reason why the edge attributes of the other graphs have been dropped?
Here is how I have defined bl_pers_receive()
.
bl_pers_receive <- function() {
W <- weightedbl_G08 %u% weightedbl_G04 %u%
weightedbl_G06 %u% weightedbl_G01 %u%
weightedbl_G09 %u% weightedbl_G24_1 %u%
weightedbl_G24_2 %u% weightedbl_G24_3
V(W)$T <- V(W)$T_1
V(W)$color <- V(W)$color_1
W <- sg(W)
return(W)
}
Here is the output when I query bl_pers_receive
.
IGRAPH 55a874b DN-- 1508 12205 --
+ attr: T_1 (v/n), T_2 (v/n), color_1 (v/c), color_2
| (v/c), name (v/c), T (v/n), color (v/c), weight_1
| (e/n), weight_2 (e/n)
+ edges from 55a874b (vertex names):
[1] 1211->1219 1211->1240 1211->1241 1211->1632 1212->1217
[6] 1212->1233 1212->1242 1212->1285 1212->1308 1212->1363
[11] 1212->1376 1213->1231 1213->1239 1213->1292 1213->1304
[16] 1213->1389 1213->1592 1213->1601 1214->1217 1214->1229
[21] 1214->1245 1214->1249 1214->1255 1214->1256 1215->1217
[26] 1215->1218 1215->1219 1215->1240 1215->1241 1215->1242
+ ... omitted several edges