Re: [R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
Thanks Jim. That's does exactly what I am looking for. - Gundala Viswanath Jakarta - Indonesia On Tue, Jun 24, 2008 at 11:13 AM, jim holtman <[EMAIL PROTECTED]> wrote: > Is this what you were looking for: > >> x <- scan(textConnection(" 1372.23718 2.277450e+04 > +74.48333 5.494448e+01 > +

Re: [R] How to get row index of sorted matrix

2008-06-23 Thread jim holtman
Is this what you were looking for: > x <- scan(textConnection(" 1372.23718 2.277450e+04 +74.48333 5.494448e+01 + 226.63590 6.023199e+02 + 1947.17564 4.044391e+04 + 178.79615 3.970006e+02 + 657.56857 3.396852e+04 + 251.60519 1.239538e+03 +78.53846 7.473607e+01 + 140.37564 2.39583

[R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
Hi, How can I get the top-3 index (sorted by "var") of the following matrix? > print(mydata) var [1,] 1372.23718 2.277450e+04 [2,]74.48333 5.494448e+01 [3,] 226.63590 6.023199e+02 [4,] 1947.17564 4.044391e+04 [5,] 178.79615 3.970006e+02 [6,]