





Dear R users, 

I used  nndist() to gain the distance of 2 nearest
neighbours of the points in my dataset. Is there a way of getting the ID numbers
of these nearest neighbours (along with their distances).

The command I used:  nn2 <- nndist(X2, k=1:2).  This is the output of the nearest neighbour distances I got (the IDs of the given points are there but their IDs aren't). Any help or suggestionsare very much appreciated. > d1to2            [,1]     [,2]

  [1,] 1.9721585 2.979509

  [2,] 1.9342647 1.972158

  [3,] 0.2402082 1.934265

  [4,] 0.2402082 2.074910  etc...

 

  

Thank you

Luc

 		 	   		  
	[[alternative HTML version deleted]]

