concor_make_igraph {concorR}R Documentation

Find CONCOR partition and create a list of igraph objects

Description

Run concor on a list of adjacency matrices and create a list of igraph objects with a specific CONCOR split added as a vertex attribute.

Usage

concor_make_igraph(adj_list, nsplit = 1)

Arguments

adj_list

A list of adjacency matrices, each representing a different relation for the same nodes.

nsplit

The total number of splits CONCOR will (attempt to) perform.

Details

This function is a wrapper for a common task: Running concor on one or more adjacency matrices, then saving the networks as igraph objects with the CONCOR partition as a vertex attribute. If multiple adjacency matrices are included in the input list, they should be multiple relations for the same nodes.

If any of the input matrices have entries other than 0 and 1, all are treated as weighted (a weight edge attribute is added to each output graph).

Value

Returns a list of igraph objects with a vertex attribute csplitn, where n is nsplit that contains the block assignment obtained from concor.

See Also

concor, concor_igraph_apply

Examples

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")
concor_make_igraph(list(a))

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")
concor_make_igraph(list(b))

concor_make_igraph(list(a, b))

[Package concorR version 0.2.1 Index]