Recall & Review
beginner
What does the
& operator do in R?The
& operator performs element-wise logical AND between two logical vectors. It compares each element and returns TRUE only if both elements are TRUE.Click to reveal answer
intermediate
Explain the difference between
& and && in R.& works element-wise on vectors, comparing each element. && only checks the first element of each vector and returns a single TRUE or FALSE.Click to reveal answer
beginner
What does the
! operator do in R?The
! operator negates a logical value or vector. It changes TRUE to FALSE and FALSE to TRUE for each element.Click to reveal answer
beginner
How does the
| operator work in R?The
| operator performs element-wise logical OR between two logical vectors. It returns TRUE if at least one element in the pair is TRUE.Click to reveal answer
intermediate
What is the difference between
| and || in R?| works element-wise on vectors, comparing each element. || only checks the first element of each vector and returns a single TRUE or FALSE.Click to reveal answer
Which operator in R performs element-wise logical AND?
✗ Incorrect
The & operator performs element-wise logical AND on vectors.
What does the
! operator do in R?✗ Incorrect
The ! operator negates logical values, turning TRUE to FALSE and vice versa.
Which operator checks only the first element of logical vectors in R?
✗ Incorrect
The && operator checks only the first element of each vector.
What is the result of TRUE | FALSE in R?
✗ Incorrect
The | operator returns TRUE if at least one operand is TRUE.
Which operator performs element-wise logical OR in R?
✗ Incorrect
The | operator performs element-wise logical OR on vectors.
Describe the differences between
& and && operators in R.Think about how these operators behave with vectors.
You got /3 concepts.
Explain how the
! operator works and give an example.Consider what happens when you apply it to a logical vector.
You got /4 concepts.