[R] While loop working with TRUE/FALSE?

Chris82 rubenbauar at gmx.de
Wed Feb 1 16:55:22 CET 2012


Hi R users,

is there any possibilty that a while loop is working like that:

z <- c(0,1,2,3,4,5,6,7,8,9)
r <- 7

   while(w == T) { 
        for ( i in 1:10 ){
                w <- r == z[i]
                print(w)  
        }
}


The loop should stop if w == TRUE


best regards

--
View this message in context: http://r.789695.n4.nabble.com/While-loop-working-with-TRUE-FALSE-tp4348340p4348340.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list