get_subgraphs | R Documentation |
Split a graph into subgraphs using the values in a vector to indicate which vertices belong together.
get_subgraphs(g, split)
g |
the graph (an igraph object) |
split |
a vector with a value for each vertex in |
A list of graphs, where each graph is a subgraph of g
containing the vertices with the same value in split
.
g=igraph::graph_from_literal(1-2,2-3:4,3-4:5:6,5-1)
split=c("A","A","B","B","A","B")
igraph::V(g);split
igraph::V(get_subgraphs(g,split)[[1]])
igraph::V(get_subgraphs(g,split)[[2]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.