sum

sum(a, b, c, ...)

sum(A)

sum(A, dimension)

Try it yourself:


sum(): add collection values

sum(values) adds the entries in a collection. It is the basic aggregate for totals, weighted calculations, and normalization.

Examples

sum([2, 4, 6]) is 12. In a matrix workflow, check which dimension is being aggregated so a row total is not mistaken for a whole-matrix total.

Related summaries

Divide a sum by a count with mean(), inspect extremes with min() and max(), and measure spread with variance(). Use size() to confirm collection shape.

Caveat

Validate that entries are finite numeric values; a missing or exceptional value can spoil a total.

All functions