Learn R Programming

testdat (version 0.4.2)

chk-uniqueness: Checks: uniqueness

Description

Check that each value in a vector is unique.

Usage

chk_unique(x)

Value

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

Arguments

x

A vector to check.

See Also

Checks: data frame helpers

Expectations: uniqueness

Other vector checks: chk-dates, chk-dummy, chk-labels, chk-patterns, chk-text, chk-values

Examples

Run this code

x <- c(NA, 1:10, NA)
chk_unique(x)

x <- c(10, 1:10, 10)
chk_unique(x)

Run the code above in your browser using DataLab