Function to compare even with NA present
This function returns TRUE wherever elements are the same, including NA's,
and false everywhere else.
Arguments
- v1
variable 1
- v2
variable 2
Value
boolean value of whether or not v1 and v2 are equal
Examples
library(cchsflow)
is_equal(1,2)
#> [1] FALSE
# FALSE
is_equal(1,1)
#> [1] TRUE
# TRUE
1==NA
#> [1] NA
# NA
is_equal(1,NA)
#> [1] FALSE
# FALSE
NA==NA
#> [1] NA
# NA
is_equal(NA,NA)
#> [1] TRUE
# TRUE