On Sun, Jun 24, 2012 at 08:37:23AM -0700, tbowlo wrote: > Perhaps an easier coding that shows what I want would be this: > > > for(i in 1:nrow(ret)) { > + retT=ret[1+i:252+i,]}
Hi. Using your previous description, i think, you mean (1+i):(252+i). Note that this is quite different from 1+i:252+i, which is equivalent to 1 + (i:252) + i. i <- 10 identical(1+i:252+i, 1 + (i:252) + i) [1] TRUE Hope this helps. Petr Savicky. ______________________________________________ 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.