This function extracts all connected components of the input which can be an "igraph" object or a "network" object and convert them as "igraph" objects.

graph_extract_components(x, directed = TRUE, bipartite_proj = FALSE,
  num_proj = 1)

Arguments

x

An igraph or a network object

directed

Whether to create a directed graph(default=TRUE)

bipartite_proj

Whether the bipartite network must be projected or not(default=FALSE)

num_proj

Numbers 1 or 2 which shows the number of projects for bipartite graphs.(default=1)

Value

a list including the components of the input as igraph objects

Details

This function seperates different components of an "igraph" or a "network" object and illustrates them as a list of independent graphs. If the input graph was bipartite and the "bipartite_proj" was TRUE, it will project it and you can decide in which project you want to continue to work with.

See also

Examples

data(zachary) graph_extract_components(zachary)
#> [[1]] #> IGRAPH ed621d9 U--- 34 78 -- #> + attr: id (v/n) #> + edges from ed621d9: #> [1] 1-- 2 1-- 3 2-- 3 1-- 4 2-- 4 3-- 4 1-- 5 1-- 6 1-- 7 5-- 7 #> [11] 6-- 7 1-- 8 2-- 8 3-- 8 4-- 8 1-- 9 3-- 9 3--10 1--11 5--11 #> [21] 6--11 1--12 1--13 4--13 1--14 2--14 3--14 4--14 6--17 7--17 #> [31] 1--18 2--18 1--20 2--20 1--22 2--22 24--26 25--26 3--28 24--28 #> [41] 25--28 3--29 24--30 27--30 2--31 9--31 1--32 25--32 26--32 29--32 #> [51] 3--33 9--33 15--33 16--33 19--33 21--33 23--33 24--33 30--33 31--33 #> [61] 32--33 9--34 10--34 14--34 15--34 16--34 19--34 20--34 21--34 23--34 #> [71] 24--34 27--34 28--34 29--34 30--34 31--34 32--34 33--34 #>