Description Usage Arguments Details Value See Also Examples
Takes a list of igraph objects, runs concor
until the desired number of
splits, and adds the final split to each object as a vertex attribute.
1 | concor_igraph_apply(igraph_list, nsplit = 1)
|
igraph_list |
The list of igraph objects for use in |
nsplit |
Number of times to split each network. |
This function is a wrapper for a common task: Running concor
on one or more
igraph objects and adding the resulting partition to each object as a vertex
attribute. If multiple igraph objects are included in the input list, they should
be multiple relations for the same nodes.
If all of the input graphs are weighted, edge weights will be used by concor
.
Returns a list of igraph objects, each with a vertex attribute csplitn
(where n
is nsplit
) that contains the block assignment obtained from
concor
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | a <- matrix(c(0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0), ncol = 4)
rownames(a) <- c("a", "b", "c", "d")
colnames(a) <- c("a", "b", "c", "d")
a.igraph <- igraph::graph_from_adjacency_matrix(a)
concor_igraph_apply(list(a.igraph))
b <- matrix(c(0, 0, 0, 4, 1, 0, 3, 0, 2, 1, 0, 1, 1, 0, 2, 0), ncol = 4)
rownames(b) <- c("a", "b", "c", "d")
colnames(b) <- c("a", "b", "c", "d")
b.igraph <- igraph::graph_from_adjacency_matrix(b, weighted = "weight")
concor_igraph_apply(list(b.igraph))
concor_igraph_apply(list(a.igraph, b.igraph))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.