Re: [R] Help: find the index of the minimum of entries

2011-08-24 Thread Henrique Dallazuanna
Try which.min(a) On Wed, Aug 24, 2011 at 1:03 PM, Chee Chen wrote: > Dear All, > I would like to ask a question on how to find the index of the minimum of > entries of a numeric vector, without using loops or user defined functions. > Suppose we have a vector: > a <- c(3,1,2) > then, > min(a) =

Re: [R] Help: find the index of the minimum of entries

2011-08-24 Thread R. Michael Weylandt
which.min() more generally which(a==min(a)) Michael Weylandt On Wed, Aug 24, 2011 at 12:03 PM, Chee Chen wrote: > Dear All, > I would like to ask a question on how to find the index of the minimum of > entries of a numeric vector, without using loops or user defined functions. > Suppose we ha

[R] Help: find the index of the minimum of entries

2011-08-24 Thread Chee Chen
Dear All, I would like to ask a question on how to find the index of the minimum of entries of a numeric vector, without using loops or user defined functions. Suppose we have a vector: a <- c(3,1,2) then, min(a) = 1 and its index is 2. Target: how to get the index of this minimum? How to get