Re: [R] If commands in a while loop

2013-11-20 Thread Hlebtomane
Oh I forgot to mention that I had the standard normal distributed RVs in the exponent to form V5. Otherwise it would make no sense. -- View this message in context: http://r.789695.n4.nabble.com/If-commands-in-a-while-loop-tp4680775p4680793.html Sent from the R help mailing list archive at Nabb

Re: [R] If commands in a while loop

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:22 PM, Hlebtomane wrote: > Unfortunately, the while loop in the following code doesn't seem to work. It > would be very nice > if someone might help me, thanks in advance: > > z = 0*c(1:1000) I think it is more likely that you don't know what z looks like. Try `head(z)`

[R] If commands in a while loop

2013-11-19 Thread Hlebtomane
Unfortunately, the while loop in the following code doesn't seem to work. It would be very nice if someone might help me, thanks in advance: z = 0*c(1:1000) while (sum(z) < 751){ for(mu in (900:1100)/1){ for(i in(1:1000)) { z[i] <- V5[i]*exp(5*mu) if (z[i] >= 1