if(test) true.expr if(test) true.expr else false.expre1 || e2 e1 && e2
&& returns TRUE if both of its operands are TRUE (in the same sense as test above). If the left operand is not TRUE, the right operand is not evaluated.
|| returns TRUE if one of its operands is TRUE (in the same sense as test above). If the left operand is TRUE, the right operand is not evaluated.
The && and || operators are members of the Ops group of generic functions.
if(mode(x)!="character" && min(x)>0) log(x) # log(x) is an error if mode(x) is "character"if (is.na(okay)) z <- z+1 else if (okay) {y <- rnorm(1); x <- runif(1)}