1) First ensure that x is not NA and then AND that with the desired check. If x were NA then it reduces to FALSE & NA and that equals FALSE.
x <- c(1, NA, 2) # test input
(!is.na(x)) & x == 2
## [1] FALSE FALSE TRUE
2) If x is a scalar then this also works because isTRUE(X) is only TRUE if the argument is TRUE and if it is anything else including NA it is FALSE.
x <- 2
isTRUE(x == 2)
## [1] TRUE
x <- 0
isTRUE(x == 2)
## [1] FALSE
x <- NA
isTRUE(x == 2)
## [1] FALSE
2a) or if x is not necessarily a scalar we can modify it like this
x <- c(1, NA, 2) # test input
sapply(x == 2, isTRUE)
## [1] FALSE FALSE TRUE
2b) or
x <- c(1, NA, 2) # test input
Vectorize(isTRUE)(x == 2)
## [1] FALSE FALSE TRUE