I am trying to remove some data list items in Mathematica, but I do not understand how Select and Union . For example, suppose I have the following list
list = {{0.10,0.20},{1.10,0.20},{0.70,0.80},{0.20,1.10}, {1.20,1.20},{0.12,0.18},{0.68,0.76}}
and only elements in (0,1)x(0,1) are needed, given that the points in the radius of the distance 0.05 are duplicates. In this example
list1 ={{0.10,0.20},{0.70,0.80}}
I don't care which element represents the equivalence class. Im doing the following:
list1 = Select[list, 0 < Part[
which gives points in (0,1)x(0,1) , but if I try to use Union , for example
Union[list1, SameTest -> (Abs[#1-#2] < 0.05 &)]
I get errors in slots.
Can someone explain to me how to do this neatly?
--- EDIT ---
Using
DeleteDuplicates[list1, Abs[Part[#1, 1] - Part[#2, 1]] < 10^-6 &]
does the trick, but I wonder why I can't work with a list of lists.