% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster-metrics.R
\name{aggregate_layers}
\alias{aggregate_layers}
\alias{lagg}
\title{Aggregate Layers}
\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{
\item{layers}{List of adjacency matrices}

\item{method}{Aggregation: "sum", "mean", "max", "min", "union", "intersection"}

\item{weights}{Optional layer weights (for weighted sum)}
}
\value{
Aggregated adjacency matrix
}
\description{
Combines multiple network layers into a single network.
}
\examples{
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)

aggregate_layers(layers, "sum")           # total edge weight
aggregate_layers(layers, "mean")          # average edge weight
aggregate_layers(layers, "union")         # edge present in any layer
aggregate_layers(layers, "intersection")  # edge present in every layer
}
