To coerce a variable to a logical use the
> x <- 2 > z <- x > 4 > z  FALSE > class(x)  "numeric" > as.logical(2)  TRUE
as.numeric() to a logical, a double will be returned.
NA is a logical value and a logical operator with an
NA will return
NA if the outcome is ambiguous.