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, 8", "1, 2, 8",
"2, 3, 5, 7", NA, "3, 5, 6, 7", "1, 3, 6, 7", "2, 3, 5, 8", "2, 3, 5, 7",
NA, "1, 3, 7", "1, 4", "3, 4, 5, 7", NA, "3, 5, 7", NA, NA, NA,
"1, 5, 7", "1, 2, 6, 7", NA, NA, "1, 2, 4, 5, 7", "2, 5, 6, 7",
"1, 4, 6, 7", "2, 5, 8", "2, 5", "5, 8", "2, 6, 7", NA, NA, "2, 7",
NA, "6, 7", NA, NA, NA, "1, 2", "1, 2, 4", "2, 4", "1, 2, 3, 4, 5",
"2, 3, 5", NA, NA, NA, NA, "2, 3, 8", "2, 8", NA, NA, "2, 3, 7",
NA, "3, 5", NA, "5, 7", NA, NA, "2, 3", "2, 3, 7", NA, NA, NA,
"3, 7", NA, NA, NA, NA, "3, 4", NA, "3, 4", NA, NA, NA), .Dim = c(9L,
9L))
I want to find which elements are duplicated ignoring the missing elements. I use the following code:
duplicated(cand, MARGIN = 0, incomparables = NA)
However, this returns the following error:
Error: argument 'incomparables != FALSE' is not used (yet)
Any thoughts?
The help page
help(duplicated)
says:So
incomparables = NA
seems to not work. However, you can get the effect that you are looking for with: