How can I apply the AND & or OR| operators to a logical vector in R?
For example:
a <- c(FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE)
Is there a simple way to
- Are all elements
TRUE? Like putting an&between each element:- when applied to the above vector it would return:
FALSE
- when applied to the above vector it would return:
- Are any elements
TRUE? Like putting a|between each element- when applied to the above vector it would return:
TRUE
- when applied to the above vector it would return: