Return the sum across rows (n=1) or columns (n=2) of a matrix

sumR(A, n)

Arguments

A

input matrix

n

if n=1 sum rows, if n=2 sum columns

Value

sum of rows or columns