[R] Finding the Min.

Pfaff, Bernhard Dr. Bernhard_Pfaff at fra.invesco.com
Tue Jan 30 10:02:38 CET 2007


?which.min

>
>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:
>   
>  i=1
>  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?
>   
>  Thanks
>  stat
>
> 				
>---------------------------------
> Here's a new way to find what you're looking for - Yahoo! Answers 
>	[[alternative HTML version deleted]]
>
>
*****************************************************************
Confidentiality Note: The information contained in this mess...{{dropped}}



More information about the R-help mailing list