xGraphSplit | R Documentation |
xGraphSplit
is supposed to split a graph according to a node
attribute such as community or comp.
xGraphSplit(g, node.attr = NULL, verbose = TRUE)
g |
an object of class "igraph" (or "graphNEL") for a graph with such as a 'community' node attribute |
node.attr |
a charatter specifying a node attribute. If NULL or no match, it returns NULL |
verbose |
logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display |
It returns a list of igraph objects.
xGraphSplit
# 1) generate a random bipartite graph set.seed(123) g <- sample_bipartite(100, 50, p=0.1) V(g)$name <- V(g) ## Not run: # 2) obtain and append the community cs <- igraph::cluster_louvain(g) V(g)$community <- cs$membership ls_ig <- xGraphSplit(g, node.attr="community") ## End(Not run)