eq | R Documentation |
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.
eq(x, y, do.nanull.equal = TRUE)
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). |
Boolean vector/value of comparisons.
c(NA,'NA',1,2,'c') == c(NA,NA,1,2,'a') # regular equality check.
eq(c(NA,'NA',1,2,'c'),c(NA,NA,1,2,'a')) # check with eq.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.