dupl_items | R Documentation |
This function takes a numeric or character vector and returns a vector of the
unique elements that appear more than once - so a simple shortcut for
unique(x[duplicated(x)])
that is particularly friendly in pipes
dupl_items(x)
x |
A numeric or character vector from which to identify duplicate elements. |
A vector containing unique elements that are duplicated in the original vector. Returns an empty vector if there are no duplicates.
dupl_items(c(1, 2, 3, 3, 4, 5, 5, 5))
# Output: 3 5
dupl_items(c(1, 2, 3, 4))
# Output: numeric(0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.