On Tue, Jan 25, 2011 at 09:05:03AM +0100, Petr Savicky wrote: [...] > to foreach loop in Perl. If v is a vector, then > > for (n in v) > > first creates the vector v and then always performs length(v) iterations.
I forgot that ‘break’ may stop the loop. See ?"for" for further information. In particular, it says You can assign to ‘var’ within the body of the loop, but this will not affect the next iteration. 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.