I would like to build a subgraph of a directed network graph with all the vertices sharing a certain vertex attribute (for example, V (Grph) $ year == "1952") and their first order (immediate) neighbors based only on the external level.
I tried ego() , make_ego_graph() , neighbors() and adjacent_vertices() .
For example, CitGraph <- make_ego_graph(Grph, 1, nodes = which(V(Grph)$year=="1952"), mode = "out") gives a list of graphs (and is not one comprehensive) and surprisingly takes two hours for the peaks of 50k this year and points to 150 thousand neighbors.
One approach that I could think of would be to combine all these graphs in a list, but I don't know how to do this. In addition, I would like to preserve the vertex attributes, since my ultimate goal is to calculate assortativity_nominal() based on another vertex attribute (in this case, geographic location).
Thanks in advance for any suggestion you may have!
r igraph network-analysis
user5835099
source share