Check if a variable is unique, i.e., there are as many unique values in the object as the total number of values

is_unique(obj)

Arguments

obj

a vector

See also

unique length

Examples

is_unique(1:7)
#> 7 unique values
#> 7 all values
#> [1] TRUE