Does the input have duplicates?

hasDuplicates(x, .xname = getNameInParent(x))

hasNoDuplicates(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Name of object defined in x. Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause set.

Note

Updated 2019-08-10.

See also

Examples

## TRUE ==== hasDuplicates(c("a", "a"))
#> [1] TRUE
hasNoDuplicates(c("a", "b"))
#> [1] TRUE
## FALSE ==== hasDuplicates(c("a", "b"))
#> [1] FALSE #> Cause: 'c("a", "b")' has no duplicates.
hasNoDuplicates(c("a", "a", "b", "b"))
#> [1] FALSE #> Cause: 'c("a", "a", "b", "b")' has duplicates at positions 2, 4.