I\'d like to construct a subgraph of a graph of a directed network with all the vertices sharing a certain vertex attribute (say, V(Grph)$year == \"1952\") and their first-o
Indeed make_ego_graph
returns a graph for the neighbourhood for each of the vertices in the list nodes
.
I suggest you to solve it using the list of edges you need to include in your subgraph, instead of the list of vertices. Assuming your list of vertices is resolved like list_of_vertices <- V(Grph)$year == "1952"
or whatever it is your condition, you would do something like,
list_of_edges <- E(your_graph)[from(list_of_vertices) | to(list_of_vertices)]
your_subgraph <- subgraph.edges(your_graph, list_of_edges)
(I'm using a directed graph.)
Hope it helps.