I need to add one half of my matrix to the other half across the diagonal. In my matrix (shown below), I need the "1" in 63,25 to be added to the "2" in 25,63, and so on for all values in the matrix.
Then I need a way to clear out half of the matrix, either above or below the diagonal.
I tried:
sum(diag(lakes_matrix)) but this did not work.
25 63 1567 40 50 60 70 80 25 0 2 0 0 0 0 0 0 63 1 0 0 0 0 0 0 0 1567 0 1 0 0 0 0 0 0 40 0 0 1 0 0 0 0 0 50 0 0 0 2 0 0 0 0 60 0 0 0 0 0 0 0 0 70 0 0 0 0 0 1 0 0 80 0 0 0 0 0 0 0 0