sum
Sums a matrix, optionally grouped by rows or cols, skipping "-" and
undefined.
API Reference
Signature
Parameters
Returns
by: "all"→ a single value (or"-").by: "rows"→ a matrix of length-1 rows, keys ascending.by: "cols"→ an array, one value per column.
Empty buckets are "-" and do not call using.
Throws
MATRIX_INVALID_AGGREGATE_OPTIONS— invalidbyor non-functionusing.