I have a matrix e.g.
[,1] [,2]
[1,] 11212 10
[2,] 133 10
[3,] 15 9
[4,] 10 9
I want to add up the times that column 2 is repeated and display this in column 1.
For this example the output would be
[,1] [,2]
[1,] 11345 1
[2,] 25 0
Cheers