Re: [R] skip for loop

2010-04-05 Thread Etienne Bellemare Racine
you can use break : for(i in 1:5) { #e.g. a <- sample(1:10, 1) # important part : if(a==3) break } a or while : a <- 0 while(a != 3){ # an operation that change a : a <- sample(1:10, 1) } Etienne Le 2010-04-05 10:46, Ravi S. Shankar a écrit : > Hi R, > > > > I am running

Re: [R] skip for loop

2010-04-05 Thread Tal Galili
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.biosta