Checking if all values are unique can be a good step in QC to ensure entries are not duplicated. If passed a list, the input is first flattened (which may result in type casting).

all_unique(vec)

Arguments

vec

A vector or list.

Examples

all_unique(c(2,1,3))
#> [1] TRUE
all_unique(c(1,1,2))
#> [1] FALSE
all_unique(list(1, "1", 2))
#> [1] TRUE