[R] Finding the Min.

From: stat stat <stat700004_at_yahoo.co.in>
Date: Tue 30 Jan 2007 - 08:45:12 GMT

Dear all R users,    

  Suppose I have a dataset like that, data =    

      1         1.957759e-09
    2         1.963619e-09
    3         1.962807e-09
    4         1.973951e-09
    5         1.983401e-09
    6         1.990894e-09
    7         2.000935e-09
    8         1.998391e-09
    9         1.973322e-09
   10         1.983202e-09

  I want to see at which row minimum value of the second column occures.    

  Therefore I made the following loop:    

  while (min(data[,2]) != data[i,2])

                          i = i+1

> i

[1] 1

  Is there any more effective way to do that in terms of time consumption?    


 Here’s a new way to find what you're looking for - Yahoo! Answers

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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 Jan 30 19:56:05 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 30 Jan 2007 - 09:30:25 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.