subgraph {igraph} | R Documentation |
subgraph
creates a subgraph of a graph, containing
only the specified vertices and all the edges among them.
subgraph(graph, v)
graph |
The original graph. |
v |
Numeric vector, the vertices of the original graph which will form the subgraph. |
The ids of the vertices will change in the subgraph of course since these are always consecutive.
A new graph object.
Gabor Csardi csardi@rmki.kfki.hu
g <- graph.ring(10) g2 <- subgraph(g, 1:7)