[R] do while loop

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Dec 13 19:37:21 CET 2009



annie Zhang wrote:
> Hi, All,
> 
> Is there a 'do while' loop in R for which I can check conditions after?  I
> checked and it seems there is only the 'while' function.


Right, but you can use repeat{} and check conditions whereever using 
if() and exit the loop with the "break" control word.

Uwe Ligges


> Thanks,
> 
> Annie
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list