wouldn't using inside the loop:
if ("a"==3){ # do one thing } else { # do another thing } Do the trick ? ----------------Contact Details:------------------------------------------------------- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Mon, Apr 5, 2010 at 5:46 PM, Ravi S. Shankar <ra...@ambaresearch.com>wrote: > Hi R, > > > > I am running a for loop in which I am doing a certain calculation. As an > outcome of calculation I get an out put say "a". Now in my for loop "I" > needs to be initiated to "a". > > > > Based the below example if the output "a"=3 then the second iteration > needs to be skipped. Is there a way to do this? > > for(i in 1:5) > > { > > ##Calculation## > > a=3 ## outcome of calculation > > } > > > > Any help appreciated. Thanks in advance for the time! > > > > Regards > > Ravi > > > > This e-mail may contain confidential and/or privileged i...{{dropped:13}} > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.