William Dunlap wrote: > The help page for ?"for" says that: > > The index seq in a for loop is evaluated at the start of the loop; > changing > it subsequently does not affect the loop. The variable var has the > same type > as seq, and is read-only: assigning to it does not alter seq. > > The help file is not right when seq is a list() or other recursive > type. In that case var has the type of seq[[i]] where i is the current > iteration count. (I think this is true in general, since [ and [[ act > the same for nonrecursive types when the indices are such that a scalar > would be returned. However that explanation is unnecessarily > complicated > in the nonrecursive case.) > > Also, the variable var is not really read-only. You can alter it but > it gets reset to the next value in seq at the start of each iteration. > You cannot affect the meaning of 'next' to force it to, e.g, omit or > repeat iterations.
Thank. We've put something more sensible into R-devel. Take a look at http://svn.r-project.org/R/trunk/src/library/base/man/Control.Rd -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 ______________________________________________ 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.