all_are_distinct: Test if all elements of a vector are unique

View source: R/utils-sfmisc.R

all_are_distinctR Documentation

Test if all elements of a vector are unique

Description

Test if all elements of a vector are unique

Usage

all_are_distinct(x, empty_value = FALSE)

Arguments

x

any object that can be handled by unique() (usually a vector or list)

empty_value

Value to return if function is called on a vector of length 0 (e.g. NULL, numeric(), ...)

Value

TRUE or FALSE

Examples

all_are_distinct(c(1,2,3))
all_are_distinct(c(1,1,1))

s-fleck/sfmisc documentation built on Nov. 21, 2023, 12:29 a.m.