Skip to content
Prev 148898 / 398498 Next

Problem in applying conditional looping

You can use something like this to keep running your algorithm


# repeat until all values are positive
repeat{
    x <- rnorm(10)
    if (all(x >= 0)) break  # conditions met; quit
}


On Thu, Jul 3, 2008 at 5:25 AM, Nadeem Shafique
<nadeemshafique at gmail.com> wrote: