Intermediate R
Q60 / 100

What is the difference between "&" and "&&" in R?

Correct! Well done.

Incorrect.

The correct answer is B) "&" performs element-wise vectorized AND on vectors, while "&&" evaluates only the first elements and short-circuits, intended for single logical values

B

Correct Answer

"&" performs element-wise vectorized AND on vectors, while "&&" evaluates only the first elements and short-circuits, intended for single logical values

Explanation

"&" is vectorized over all elements, while "&&" (and "||") evaluate left to right and stop as soon as the result is determined, working on single values.

Progress
60/100