Re: [R] how do I find the row index number, or row name, of a given value in a vector?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat 21 Oct 2006 - 16:09:37 GMT

?which.max

On 10/21/06, tom soyer <tom.soyer@gmail.com> wrote:
> Hi,
>
> I noticed that max(x) returns the maximum value of a vector, but the
> function doesn't give the user the option of retrieving the row index number
> instead. If I used max(x) to find the maximum value of vector x, then is
> there a function I can use to find the index number, or row name, of the
> maximum value?
>
> Thanks,
>
> Tom
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Sun Oct 22 04:43:48 2006

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 Sat 21 Oct 2006 - 19:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.