Complete the code to create a logical variable with value TRUE.
flag <- [1]In R, logical TRUE is written as TRUE (all uppercase, no quotes).
Complete the code to check if 5 is greater than 3 and store the result in a logical variable.
result <- 5 [1] 3
The expression 5 > 3 returns TRUE because 5 is greater than 3.
Fix the error in the code to correctly assign a logical FALSE value.
is_valid <- [1]Logical FALSE in R is written as FALSE (all uppercase, no quotes).
Fill both blanks to create a logical vector with TRUE and FALSE values.
vec <- c([1], [2])
Logical vectors use TRUE and FALSE without quotes.
Fill all three blanks to create a logical vector with TRUE, FALSE, and the result of 2 == 2.
vec <- c([1], [2], [3])
The vector contains logical TRUE, logical FALSE, and the result of the comparison 2 == 2 which is TRUE.
