Learn R Programming

cograph (version 2.0.0)

aggregate_layers: 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 )

Value

Aggregated adjacency matrix

Arguments

layers

List of adjacency matrices

method

Aggregation: "sum", "mean", "max", "min", "union", "intersection"

weights

Optional layer weights (for weighted sum)

Examples

Run this code
# layers <- list(L1 = mat1, L2 = mat2, L3 = mat3)
# aggregate_layers(layers, "sum")           # Total
# aggregate_layers(layers, "mean")          # Average
# aggregate_layers(layers, "union")         # Any edge
# aggregate_layers(layers, "intersection")  # All edges

Run the code above in your browser using DataLab