View source: R/cluster-metrics.R
| supra_adjacency | R Documentation |
Builds the supra-adjacency matrix for multilayer networks. Diagonal blocks = intra-layer, off-diagonal = inter-layer.
supra_adjacency(
layers,
omega = 1,
coupling = c("diagonal", "full", "custom"),
interlayer_matrices = NULL
)
supra(
layers,
omega = 1,
coupling = c("diagonal", "full", "custom"),
interlayer_matrices = NULL
)
layers |
List of adjacency matrices (same dimensions) |
omega |
Inter-layer coupling coefficient (scalar or L x L matrix) |
coupling |
Coupling type: "diagonal", "full", or "custom" |
interlayer_matrices |
For
If no entry matches a pair and no legacy chain layout applies, a
warning is emitted and the diagonal default |
A supra-adjacency matrix of dimension (NL) x (NL) with class
c("supra_adjacency", "matrix"). Diagonal N x N blocks hold the
intra-layer adjacencies and off-diagonal blocks the inter-layer coupling.
The attributes "n_nodes", "n_layers", "node_names",
"layer_names", "omega" and "coupling" record the
construction and are read back by supra_layer() and
supra_interlayer().
nodes <- c("A", "B", "C")
l1 <- matrix(c(0, 1, 0, 1, 0, 1, 0, 1, 0), 3, 3, dimnames = list(nodes, nodes))
l2 <- matrix(c(0, 1, 1, 1, 0, 0, 1, 0, 0), 3, 3, dimnames = list(nodes, nodes))
layers <- list(L1 = l1, L2 = l2)
# 3 nodes x 2 layers gives a 6 x 6 supra-adjacency matrix.
s <- supra_adjacency(layers, omega = 0.5)
dim(s)
s
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.