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

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

a) Both are the same
b) && is for element-wise comparison, and & is for logical AND
c) & is for element-wise comparison, and && is for logical AND
d) && is faster than &

Answer:

c) & is for element-wise comparison, and && is for logical AND

Explanation:

In R, & performs element-wise comparison, while && evaluates the first element only in a logical AND operation.

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