[R] Finding an index of matrix[i,j]

Wolfgang Viechtbauer wviechtb at s.psych.uiuc.edu
Fri Oct 26 22:04:02 CEST 2001


I hope somebody can help me out with this. Let's say I have a matrix with
i rows and j columns and I want to find the index of the row AND column of
the maximum value in the matrix. I tried to play around with the which()
command, but couldn't find an easy solution that didn't involve loops and
various other inelegant approaches. I hope that there is an easy way of
doing this. Thanks in advance for any suggestions!

------------------------------------------------------------------------
Wolfgang Viechtbauer                       wviechtb at s.psych.uiuc.edu
Department of Quantitative Psychology      viechtba at students.uiuc.edu

University of Illinois, Champaign-Urbana   [Virus  based  on  an honors-
Room 409, Psychology Building              system:  Forward  this  to 10
603 E. Daniel Street                       random  people  and  delete a
Champaign, IL 61820                        bunch of your files. Thanks.]

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list