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,]
testM[,c(T,F)]+testM[,c(F,T)]; ## [,1] [,2] ## [1,] 12 52 ## [2,] 14 54 ## [3,] 16 56 ## [4,] 18 58 ## [5,] 20 60 ## [6,] 22 62 ## [7,] 24 64 ## [8,] 26 66 ## [9,] 28 68 ## [10,] 30 70