Complete the code to perform element-wise logical AND on vectors a and b.
result <- a [1] bIn R, & performs element-wise logical AND between vectors.
Complete the code to perform element-wise logical OR on vectors x and y.
result <- x [1] yThe | operator performs element-wise logical OR in R.
Fix the error in the code to negate the logical vector v.
negated <- [1]vThe ! operator negates each element of a logical vector in R.
Fill both blanks to create a vector of TRUE where elements of a are TRUE and elements of b are FALSE.
result <- a [1] [2]b
Use & for element-wise AND and ! to negate vector b.
Fill all three blanks to create a vector where elements are TRUE if a is TRUE or b is FALSE, but not both.
result <- (a [1] ([2]b)) [3] (a [1] b)
This expression uses OR |, NOT !, and XOR ^ to get TRUE where only one condition is TRUE.
