In my data frame, I am having some single observations and some double observations. In the situation of double observations in x, I want to pick the row with the lower 'y' value so that in future I can remove that row.
ex <- data.frame('x'= c(1:5, 1:3,5:6), 'y'= c(70,73,72,49,60,14,50,46,13,29))
The original data frame is:
And this is what I want: