Description Usage Arguments Examples
Unlike base R's 'duplicated' function, this function returns a vector of indices of all duplicated elements of a vector including the first instance.
1 | duplicates(vector, value = FALSE)
|
vector |
A vector containing duplicated elements. |
value |
Parameter similar to grep's: if FALSE, a vector containing the indices of all duplicated elements will be returned, but if TRUE, the offending elements themselves are returned. |
1 2 3 4 5 6 | dup.vec <- c(1:9, 1:4, 11:15, 14:18)
duplicates(dup.vec)
[1] 1 2 3 4 10 11 12 13 17 18 19 20
duplicates(dup.vec, value = TRUE)
[1] 1 2 3 4 1 2 3 4 14 15 14 15
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.