In the R system, missing values may have different types.
For example, if an entry is missing from a numeric vector, it is a
missing numeric value, not a missing logical value, and R
distinguishes between these two types of missing values.
The function RelevantNA
returns a missing value of the same
type as the input x
(as defined by typeof
).
Thus, RelevantNA(3.2)
returns a missing numeric value
and RelevantNA(TRUE)
returns a missing logical value.
RelevantEmpty(x)
returns a vector of length zero which has the
same type as x
. Thus, RelevantEmpty(TRUE)
is equivalent
to logical(0)
.
RelevantZero(x)
returns a single value, of the same type as
x
, that is equivalent to the number zero. For example,
RelevantZero(TRUE)
returns FALSE
.
The function isRelevantZero
tests whether x
is a single
zero value, by testing whether x
is identical to
RelevantZero(x)
.