[R] Subsetting Matrix

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Sat Sep 28 00:57:28 CEST 2002


Hi,

This is an easy question, however I cannot remember the exact command of
doing it :-(

Say I have a matrix:
  > ff
             [,1]      [,2]
   [1,] 0.1000000 116.76987
   [2,] 0.6444444 108.26811
   [3,] 1.1888889  95.00240
   [4,] 1.7333333 112.13647
   [5,] 2.2777778 107.39893
   [6,] 2.8222222 115.34615
   [7,] 3.3666667  97.81029
   [8,] 3.9111111 105.35119
   [9,] 4.4555556 105.50052
  [10,] 5.0000000 111.35761

And I'd like to display the number in the first column, where its
corresponding number is the minimum of the second column.

In other words, I'd like to be able to extract out 1.1888889 from column
1, as its correponding number in column 2 (95.00240) is the smallest in
the column.



Cheers,

Kevin

------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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