I have the following matrix:
structure(c(NA, NA, \"2, 3, 5, 7\", \"1, 3, 5, 7\", NA, \"1, 3, 7\",
\"2, 3, 5, 8\", \"2, 3, 5, 7\", \"1, 5, 7, 8\", \"1, 2, 3, 7,
The help page help(duplicated)
says:
incomparables
a vector of values that cannot be compared. FALSE is a special value, meaning that all values can be compared, and may be the only value accepted for methods other than the default. It will be coerced internally to the same type as x.
So incomparables = NA
seems to not work. However, you can get the effect that you are looking for with:
duplicated(cand, MARGIN = 0) & !is.na(cand)