Skip to contents

Does the input have duplicates?

Usage

hasDuplicates(x)

hasNoDuplicates(x)

Arguments

x

Object.

Value

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

Note

Updated 2023-01-12.

See also

  • assertive.properties::has_duplicates().

  • assertive.properties::has_no_duplicates().

Examples

## TRUE ====
hasDuplicates(c("a", "a"))
#> [1] TRUE
hasNoDuplicates(c("a", "b"))
#> [1] TRUE

## FALSE ====
hasDuplicates(c("a", "b"))
#> [1] FALSE
hasNoDuplicates(c("a", "a", "b", "b"))
#> [1] FALSE