[R] How to get row index of sorted matrix

From: Gundala Viswanath <gundalav_at_gmail.com>
Date: Tue, 24 Jun 2008 10:35:07 +0900


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,] 657.56857 3.396852e+04
[7,] 251.60519 1.239538e+03
[8,] 78.53846 7.473607e+01
[9,] 140.37564 2.395830e+02
 [10,] 358.13718 1.508718e+03
R-help_at_r-project.org 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. Received on Tue 24 Jun 2008 - 01:39:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 24 Jun 2008 - 02:31:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive