Yes, of course.

ID      loc     
1       144     
2       144     
3       140     
4       126     
5       120     
6       112             
7       100     
8       99      
9       91      
11      90              
12      90              
13      89              
15      86              
16      85              
17      85              
18      80      
19      79      
20      79      
21      78      
22      78              
23      76      
24      74      
25      73      
26      72              
27      71      
28      68      
29      68      
30      68
.       .       
.       .
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 are closest to ID
> 100 I want to randomly choose one of the ID's to select 10 ID's total.
> 
> Thank you
> 
>  
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Selecting-closest-values-tp22647126p22648754.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to