Re: [R] Selecting closest values

2009-03-22 Thread P_M
. . . . 185 -22 P_M wrote: > > Hi > I have a table with ID (1 to 183) and Location (144 to -22). > My problem is that I want to select the 10 ID's that are closest in > Location to ID 1, ID 2 and so on. > Also, some ID have the same Location. Say, if 11 ID's ar

[R] Selecting closest values

2009-03-22 Thread P_M
Hi I have a table with ID (1 to 183) and Location (144 to -22). My problem is that I want to select the 10 ID's that are closest in Location to ID 1, ID 2 and so on. Also, some ID have the same Location. Say, if 11 ID's are closest to ID 100 I want to randomly choose one of the ID's to select 10 I