Re: [R] Nearest neighbour in a matrix

2011-10-01 Thread Spartina
Hi, sorry for the late reply. I just wanted to thank both of you for your answers. They were helpful and also thank you for mentioning the website that has the tutorials which is a most helpful resource. Cheers, Léa -- View this message in context: http://r.789695.n4.nabble.com/Nearest-neighbou

Re: [R] Nearest neighbour in a matrix

2011-09-26 Thread David Winsemius
On Sep 26, 2011, at 7:56 PM, Spartina wrote: Hello all, I am brand new to R and doing an exercise for a class. I need to find the nearest neighbour for points in the following matrix: DistanceMatrix x1 x2 x3 x4 x5 [1,] 0.00 2.828427 1.581139 2.236068

Re: [R] Nearest neighbour in a matrix

2011-09-26 Thread R. Michael Weylandt
There's a general no homework policy on this list, but if you use apropos() with some fairly intuitive search terms the problem won't be hard at all once you hit the 'magic' function. You also might want to look at "?apply". After that, ask your TA... Sorry we couldn't be more help, Michael

[R] Nearest neighbour in a matrix

2011-09-26 Thread Spartina
Hello all, I am brand new to R and doing an exercise for a class. I need to find the nearest neighbour for points in the following matrix: > DistanceMatrix x1 x2 x3 x4 x5 [1,] 0.00 2.828427 1.581139 2.236068 2.00 [2,] 2.828427 0.00 1.581139 4.123106