[R] Help with a repeating process

tbowlo tbowlo at gmail.com
Sun Jun 24 17:22:12 CEST 2012


I am trying to create a looping function that takes 252 rows of a matrix from
1, then the next 252 rows of a matrix from 1+1, so on and so forth until
nrow of the matrix.

I am using the for + if loop combo but I seem to be stuck on the if portion.
I'm trying to code if so that if the row is less than the last row in matrix
ret, it will keep running, else break.

Here is what I have so far:

for(i in 1:i+252) {
+ if(ret[<=nrow(ret),])


Any help would be appreciated very very much. Thank you!

--
View this message in context: http://r.789695.n4.nabble.com/Help-with-a-repeating-process-tp4634336.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list