Suppose I had the following matrix:
matrix(c(1,1,2,1,2,3,2,1,3,2,2,1),ncol=3)
Result:
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 1 3 2
[3,] 2 2 2
[4,] 1 1 1
How can I filter/subset this matrix by whether or not each row has duplicate values? For example, in this case, I would only want to keep row 1 and row 2.
Any thoughts would be much appreciated!