betterComp: Better Comparison

Description Usage Arguments Value Note Examples

View source: R/betterComp.R

Description

Test two values for equality, where NA is equal to NA

Usage

1
betterComp(x, y = NULL)

Arguments

x

A numeric vector of length 1 or 2

y

A numeric vector of length 1 (if /codex is atomic) or NULL

Value

TRUE if the two values are equal or if both are NA, and FALSE if they are not equal or if exactly one is NA

Note

Instead of two arguments, this function will also accept a single vector of length 2 and compare the the two elements.

Examples

1
2
3
4
5
6
7
betterComp(5, 5)
betterComp(9, NA)
betterComp(5, 6)
betterComp(NA, 7)
betterComp(NA, NA)
valuesToCheck = c(10, 13)
betterComp(x = valuesToCheck)

debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.