[R] for loop problem
tobias_verbeke at skynet.be
Mon Jul 14 13:18:26 CEST 2003
Thank you for your kind reply.
> > In what way am I ill-treating R ?
> You're ill-treating the readers by not
> giving a full example of a
> call to the function...
> However: in the for loop, i will be one of
> 0,1,5,10 and n is the vector c(1,4,5,5)
> so n[i+1] is indexing out of
> bounds and e.g.
> > n
>  NA
> and the : operator subsequently objects.
> Did you mean (i+1):(i+n[j]+1) or so?
Yes! I meant (i+1):(i+n[j])
More information about the R-help