Description Usage Arguments Value Author(s) Examples
Determine duplicates. duplicates
returns a logical vector,
duplicatei
an integer vector.
1 2 3 | duplicates(x)
duplicatei(x, first = TRUE)
|
x |
A vector or data.frame to search for duplicates. |
first |
Logical, |
duplicates
returns a logical vector as duplicated, but with
TRUE
values also for the first occurrence of duplicated values.
duplicatei
returns the index of the first occurrence of each unique
value.
Sven E. Templer
1 2 3 4 5 6 7 8 9 10 11 | #
x <- c(7, 7, 7, 2, 3, 2)
data.frame(
data = x,
duplicated = duplicated(x),
duplicates = duplicates(x),
duplicatei = duplicatei(x),
duplicatei0 = duplicatei(x, FALSE))
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.