Skip to contents

This S3 method computes column sums for ENA matrix objects, with optional binarization. It is used to summarize connection counts across rows (e.g., for each unit or context).

Usage

colSums.ena.matrix(x, na.rm = FALSE, dims = 1L, binary = FALSE)

Arguments

x

An object of class "ena.matrix" (or compatible matrix/data.frame) containing connection data.

na.rm

Logical; whether to remove missing values (passed to `colSums`).

dims

Integer; which dimensions to sum over (passed to `colSums`).

binary

Logical; if TRUE, binarizes the matrix before summing (i.e., all nonzero values become 1).

Value

A numeric vector of column sums for the matrix.