[R] Help with a repeating process

Petr Savicky savicky at cs.cas.cz
Sun Jun 24 20:22:33 CEST 2012


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.



More information about the R-help mailing list