Looking for a R function to sum rows and columns.
I have a matrix (6x6). I want to sum [1,1]+[1,2]+[2,1]+[2,2], and then the same for the rest of the matrix, finally I want to get a 3x3 matrix, in which each [i,j] as the respective sum.
Looking for a R function to sum rows and columns.
I have a matrix (6x6). I want to sum [1,1]+[1,2]+[2,1]+[2,2], and then the same for the rest of the matrix, finally I want to get a 3x3 matrix, in which each [i,j] as the respective sum.
You can try something like this: