What does the operator || do in R?

What does the operator || do in R?

a) Logical OR with element-wise comparison
b) Logical AND
c) Logical OR with short-circuiting
d) Logical XOR

Answer:

c) Logical OR with short-circuiting

Explanation:

The || operator is a logical OR operator in R with short-circuiting, meaning it evaluates only the first element of the condition.

Reference:

R Programming – Operators MCQ Questions and Answers

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top