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
You could index out the elements you want to sum
sum(m[cbind(3:1, 1:3)])