Description Usage Arguments Details Value See Also Examples
Test for duplicates in one or a combination of vectors.
1 2 3 4 5 6 7 8 9 |
... |
vectors to concatenate. |
sep |
a string used to when concatenating the vectors. See |
incomparables |
FALSE or a vector of incomparable—i.e., never-duplicate—values. See |
named |
when TRUE, the output is named with the |
This function should not be used in places of duplicated()
and does not return duplicates.
Instead, detect_duped()
executes the common pattern
vector %in% vector[duplicated(vector)]
.
Providing multiple vector arguments to ...
concatenates the vectors element-wise
before testing for duplicates in the new vector.
A logical vector of the same length as input vectors. TRUE values mark elements that are duplicates or are duplicated.
duplicated
and interaction
.
1 2 3 4 5 6 | state <- c("CA", "CA", "FL", "CA", "FL", "FL")
cd <- c(22, 11, 22, 22, NA, NA)
data.frame(state, cd,
dup = detect_duped(state, cd),
dup2 = detect_duped(state, cd, incomparables = NA))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.