Learn R Programming

tma (version 0.3.1)

colSums.ena.matrix: Column Sums for ENA Matrices (S3 method)

Description

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)

Value

A numeric vector of column sums for the matrix.

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).