3.4 Logical operations
3.4.1 Vectorized logical operations:
TRUE
and FALSE
can also be a result of a “predicate”:
==
and >
(and co.) only accept two arguments (binary operators):
We need to use logical operators (help("Logic")
).
Logical operators:
!
not (Unary)&
and: are both true|
or: at least one truexor
exclusive-or: one and only one is true
(We will see their scalar counter part in chapter 8)
Those operators have lower precedence than the arithmetic so they are quite intuitive (except maybe !
)
3.4.2 missingness
NA
|TRUE
->TRUE
(this one is easy)NA
|FALSE
->NA
because it depend on whatNA
could be
(in doubt build a quick truth tables)