Skip to content

Instantly share code, notes, and snippets.

@vikjam
Last active January 11, 2017 01:01
Show Gist options
  • Save vikjam/99cd2b0f6339cd5d03efcd834b802efd to your computer and use it in GitHub Desktop.
Save vikjam/99cd2b0f6339cd5d03efcd834b802efd to your computer and use it in GitHub Desktop.
Include NA in test
'%==%' <- function(a, b) {
equality.test <- (a == b)
equality.test[is.na(a) & is.na(b)] <- TRUE
equality.test[is.na(equality.test)] <- FALSE
return(equality.test)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment