Probably this would be easy. I have a Matrix:
testM <- matrix(1:40, ncol = 4, byrow = FALSE) testM [,1] [,2] [,3] [,4] [1,] 1 11 21 31 [2,]
How about:
matrix(c(testM[, 1] + testM[, 2], testM[, 2] + testM[, 4]), nrow = 10)