checkmate
checkmate copied to clipboard
do not error out on duplicate NAs if any.missing = TRUE
I kinda sorta expected the below to yield TRUE, but:
check_character(x = c("foo", NA, NA), any.missing = TRUE, unique = TRUE)
# > [1] "Contains duplicated values"
I guess that strictly speaking is true; NA is duplicate.
My intention here was to test whether the non-NAs were duplicate.
Am I using this wrong, or could the behavior of checkmate be changed here?
I guess you could make arguments for either behavior. This is probably the reason why the duplicated() function has an incomparables argument. I'll look into how difficult it is to pass an incomparables argument around in checkmate.