[R] find the index of the smallest or biggest number in a vetor or data.frame

tedzzx zengzhenxing at gmail.com
Thu Mar 19 14:15:38 CET 2009


Dear R experts,

How to find out the index of minimum or maxmum number in a vetor or
data.frame?

For example,

a=

n   price
1     50
-2    100
0    200
-1   300
......


I want to find out the row which the n is the smallest or largestest and
extract the price.


Thanks

Ted
-- 
View this message in context: http://www.nabble.com/find-the-index-of-the-smallest-or-biggest-number-in-a-vetor-or-data.frame-tp22599905p22599905.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list