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

Gabor Grothendieck ggrothendieck at gmail.com
Sat Oct 21 18:09:37 CEST 2006


?which.max

On 10/21/06, tom soyer <tom.soyer at 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 at 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.
>



More information about the R-help mailing list