Re: [R] how to get the index of entry with max value in an array?

From: Feng Qiu <>
Date: Thu 18 Jan 2007 - 05:49:17 GMT

Thank you guys! I got it.



> which.max()
> b
> On Jan 17, 2007, at 11:20 PM, Feng Qiu 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 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 18 20:06:39 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 18 Jan 2007 - 09:30:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.