Hello, I am trying to loop through a matrix column and find the first value <=0 and store that matrix location in a variable called Start.
I have tried the following: i <- 1 j <- 1 while (Matrix[i, j] > 0) i = (i + 1) #loop until matrix [i, j] value <= 0 #strore that row number in a variable Start <- i I am getting a scripting out of bounds error and I suspect maybe the loop isnt stoping at the end of the matrix? Any help is greatly appreciated! Cheers, Rheannon -- View this message in context: http://www.nabble.com/While-loop-tp18408462p18408462.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.