Vectorized flexible equality comparison which considers NAs as a value. Returns TRUE if both values are NA, and FALSE when only one is NA.
The standard == comparison returns NA in both of these cases and sometimes this is interpreted unexpectedly.
Author: Bryce Chamberlain. Tech Review: Maria Gonzalez.
Usage
eq(x, y, do.nanull.equal = TRUE)
Value
Boolean vector/value of comparisons.
Arguments
x
First vector/value for comparison.
y
Second vector/value for comparison.
do.nanull.equal
Return TRUE if both inputs are NA or NULL (tested via easyr::nanull).