Check that each value in a vector is unique.

chk_unique(x)

Arguments

x

A vector to check.

Value

A logical vector flagging records that have passed or failed the check.

Examples


x <- c(NA, 1:10, NA)
chk_unique(x)
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

x <- c(10, 1:10, 10)
chk_unique(x)
#>  [1] FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE