Opoosite of duplicated(). Checks which elements of a vector or data frame are NOT duplicates of elements with smaller subscripts
Arguments
- x
a vector or a data frame or an array or NULL.
- incomparables
a vector of values that cannot be compared. FALSE is a special value, meaning that all values can be compared, and may be the only value accepted for methods other than the default. It will be coerced internally to the same type as x
- ...
arguments for particular methods.
Examples
set.seed(08082023)
dtf <- sample(1:10,15, replace = TRUE)
dtf # 3 9 10 3 8 9 6 10 5 1 2 2 2 9 8
#> [1] 3 9 10 3 8 9 6 10 5 1 2 2 2 9 8
dtf[ dtf > 4 & duplicated(dtf) ] # 9 10 9 8
#> [1] 9 10 9 8
dtf[ dtf > 4 & not.duplicated(dtf) ] # 9 10 8 6 5
#> [1] 9 10 8 6 5