dat = data.frame(do.call("rbind", list(c(1.5, 1.5, 1.5, 1.5, 1.5), c(1, 2, 3, 4, 5),
c(3, 3, 3, 3, 3), c(1, 2, 2, 3, 4))))
dat
X1 X2 X3 X4 X5
1 1.5 1.5 1.5 1.5 1.5
2 1.0 2.0 3.0 4.0 5.0
3 3.0 3.0 3.0 3.0 3.0
4 1.0 2.0 2.0 3.0 4.0
Here I'd like to remove rows 1 and 3 because the elements in those rows are the same. I want the resulting data.frame
to just consist of rows 2 and 4. What's a quick way to do this without writing a loop?