zero_col: Check for empty matrix columns (or rows)
Description
More generally, checks that both row/col sums and sums of absolute
values equal a target.
For value = 0, this means all entries are zero.
single_col() is a wrapper with value = 1, often used to check for
dummy columns/rows with exactly one element that is 1.
Usage
zero_col(x, rows = FALSE, value = 0)
single_col(..., value = 1)
Value
Logical vector.
Arguments
x
Numeric matrix. Sparse matrices from the Matrix package are also supported.
rows
Logical; if TRUE check rows, else columns.
value
Numeric target (default 0).
...
Passed to zero_col().
Details
Memory usage is reduced by applying abs() checks only to rows/columns
whose total sum is already the target.