Re: [R] Finding the Min.

From: Pfaff, Bernhard Dr. <Bernhard_Pfaff_at_fra.invesco.com>
Date: Tue 30 Jan 2007 - 09:02:38 GMT

?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}}

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 20:07:24 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.