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

2009-03-19 Thread Henrique Dallazuanna
Try this: # for the minimum a$price[which.min(a$n)] # for the maximum a$price[which.max(a$n)] On Thu, Mar 19, 2009 at 10:15 AM, tedzzx wrote: > > 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

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

2009-03-19 Thread Tsjerk Wassenaar
?which On Thu, Mar 19, 2009 at 2:15 PM, tedzzx wrote: > > 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

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

2009-03-19 Thread tedzzx
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 -2100 0200 -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 messag