Re: [R] locating minimum value in matrix

2011-10-20 Thread ISMA11
Hi, I was looking for a solution to the same problem. I just found something and thought it might be useful to share. Suppose you look for the positions of the minimum value in matrix D. Using a little euclide division solves the problem easily. Here is my code. min(D) Dv=as.vector(D) pos=which.

Re: [R] locating minimum value in matrix

2008-03-15 Thread Chuck Cleland
On 3/15/2008 7:47 PM, Gonçalo Ferraz wrote: > Hi, > > I have a matrix BEE and want to find the row and column numbers of > the minimum value in that matrix. > The command > > which(BEE==min(BEE)) > > returns only one value which, I take, is the position of the minimum > in a vector with as m

Re: [R] locating minimum value in matrix

2008-03-15 Thread Bill.Venables
Yes, they've thought of that. which(BEE == min(BEE), arr.ind = TRUE) will do it. Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 440