stat stat wrote: > I want to see at which row minimum value of the second column occures. > > Therefore I made the following loop:
[snip while-loop] > > Is there any more effective way to do that in terms of time consumption? I don't know about timing, but I understand that loops are somewhat slow. Assuming that x is the first column and y is the second column: D <- data.frame( x = 1:10, y = rnorm(10) ) D$x[ which.min(D$y) ] See the help of which.min for more info. -Jarimatti ______________________________________________ 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.