These operators act on raw, logical and number-like vectors.
! x
x & y
x && y
x | y
x || y
xor(x, y)<p></p><p>isTRUE (x)
isFALSE(x)</p>
| Parameter | Description |
|---|---|
x, y |
raw, logical or ‘number-like’ vectors (i.e., of types double (class numeric), integer and complex), or objects for which methods have been written. |
# NOT RUN {
y <- 1 + (x <- stats::rpois(50, lambda = 1.5) / 4 - 1)
x[(x > 0) & (x < 1)] # all x values between 0 and 1
if (any(x == 0) || any(y == 0)) "zero encountered"
## construct truth tables :
x <- c(NA, FALSE, TRUE)
names(x) <- as.character(x)
outer(x, x, "&") ## AND table
outer(x, x, "|") ## OR table
# }