Quantcast
Channel: Simplify while loop in R - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by John Coleman for Simplify while loop in R

Using the %in% operator, you could replacewhile (sum(diceRoll) != 2 && sum(diceRoll) !=3 && sum(diceRoll) !=12)bywhile (!(sum(diceRoll) %in% c(2,3,12)))The problem with your proposed...

View Article



Simplify while loop in R

how do I simplify this while loop? It doesn't seem to work when I put != 2 && 3 && 12.Thank youwhile (sum(diceRoll) != 2 && sum(diceRoll) !=3 && sum(diceRoll) !=12)

View Article
Browsing all 2 articles
Browse latest View live


Latest Images