I hope the question is not too foolish.
Is there a built-in R function that returns TRUE
when all the cases are FALSE
?
Similar to any()
or all()
but when, in the case of a logical vector of 2, TRUE
TRUE
returns FALSE
, TRUE
FALSE
returns FALSE
and FALSE
FALSE
returns TRUE
.
I would call it none()
.
We can use !
with any
!any(c(FALSE, FALSE))
Negate(any)
?
> none <- Negate(any)
> none(c(TRUE,TRUE))
[1] FALSE
> none(c(TRUE,FALSE))
[1] FALSE
> none(c(FALSE,FALSE))
[1] TRUE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With