checkmate icon indicating copy to clipboard operation
checkmate copied to clipboard

do not error out on duplicate NAs if any.missing = TRUE

Open maxheld83 opened this issue 7 years ago • 1 comments

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?

maxheld83 avatar Aug 14 '18 20:08 maxheld83

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.

mllg avatar Sep 06 '18 14:09 mllg