aggregate_layers: Aggregate Layers

View source: R/cluster-metrics.R

aggregate_layersR Documentation

Aggregate Layers

Description

Combines multiple network layers into a single network.

Usage

aggregate_layers(
  layers,
  method = c("sum", "mean", "max", "min", "union", "intersection"),
  weights = NULL
)

lagg(
  layers,
  method = c("sum", "mean", "max", "min", "union", "intersection"),
  weights = NULL
)

Arguments

layers

List of adjacency matrices of the same dimensions

method

Aggregation: "sum" (default), "mean", "max", "min", "union" or "intersection". "union" and "intersection" return a binary matrix of the cells with a positive weight in any or in every layer.

weights

Optional numeric vector of layer weights, one per layer, used only by method = "sum" to compute a weighted sum.

Value

The aggregated adjacency matrix, with the dimnames of the first layer. A list with a single layer is aggregated the same way, so "union" and "intersection" binarize it and "sum" multiplies it by its layer weight.

Examples

layers <- list(forward = regulation_net, backward = t(regulation_net))
aggregate_layers(layers, method = "mean")

cograph documentation built on Nov. 19, 2026, 5:07 p.m.