Re: [R] finding index of maximum value in vector

From: Kjetil Brinchmann Halvorsen <kjetilbrinchmannhalvorsen_at_gmail.com>
Date: Mon 19 Dec 2005 - 06:37:22 EST

Jean-Luc Fontaine wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I found:
> max.col(matrix(c(1,3,2),nrow=1))
> Is there a more concise/elegant way?

which.max

> Thanks,
>
> - --
> Jean-Luc Fontaine http://jfontain.free.fr/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iD8DBQFDpbfAkG/MMvcT1qQRAjGnAJsH+9MWuiv+K+US0McW2fLzRx2LHwCfYpNG
> gWKLuxnnlNde8WEr7wU5NUM=
> =7/gr
> -----END PGP SIGNATURE-----
>
> ______________________________________________
> 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
>



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 Received on Mon Dec 19 06:49:00 2005

This archive was generated by hypermail 2.1.8 : Mon 19 Dec 2005 - 09:32:05 EST