which.max > a <- sample(1:10,10) > a [1] 3 4 5 7 2 8 9 6 10 1 > which.max(a) [1] 9 >
On 1/17/07, Feng Qiu <[EMAIL PROTECTED]> wrote: > > Hi all: > A short question: > For example, a=[3,4,6,2,3], obviously the 3rd entry of the array > has the maxium value, what I want is index of the maxium value: 3. is there > a neat expression to get this index? > > Thank you! > > Best, > > Feng > > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] 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. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? [[alternative HTML version deleted]] ______________________________________________ [email protected] 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.
