Creating Subgraph using igraph in R
问题 I need to obtain a subgraph of the seed nodes (the input list of nodes; file.txt) and their first interactors (neighbours) from a graph (g) using igraph. Unfortunately, I am ending up with only a single node in the subgraph, and not all the rest of the nodes and edges (vertices) which interlink them. g<-read.graph("DATABASE.ncol",format="ncol",directed=FALSE) #load the data g2<-simplify(g, remove.multiple=TRUE, remove.loops=TRUE) # Remove the self-loops in the data DAT1 <- readLines("file.txt