So I have a data frame with 2 columns that have TRUE and FALSE values.
I want to find the rows that contain TRUE for both columns in a given row, and create a vector with Boolean values, only outputting TRUE if it meets the criteria above.
E.g.
dat <- data.frame(a = c(TRUE,TRUE,FALSE), b = c(TRUE,FALSE,FALSE)
So with the code, it should output a vector with TRUE,FALSE,FALSE, since the first row contains two TRUE values, so it output TRUE while the rest output FALSE.
What I have tried:
I have tried using the apply function but don't know how to use it to extract the correct boolean values for rows that contain TRUE for both columns for each given row.