I\'m trying to sum the elements along the antidiagonal (secondary diagonal, minor diagonal) of a matrix.
So, if I have a matrix m:
m <- matrix(c(2
This is sometimes called the "secondary diagonal" or "minor diagonal".
Another short solution:
sum(diag(apply(m,2,rev)))