x1 <- c(TRUE, TRUE, FALSE, FALSE)
x2 <- c(FALSE, TRUE, TRUE, FALSE)
mode_selection(x1, x2, "none")
mode_selection(x1, x2, "and")
mode_selection(x1, x2, "or")
mode_selection(x1, x2, "xor")
mode_selection(x1, x2, "not")
mode_selection(x1, x2, "complement")
mode_selection(x1, c(2, 3), "and") # equivalent to x2
Run the code above in your browser using DataCamp Workspace