Last chance! 50% off unlimited learning
Sale ends in
Checks if columns have unique rows.
check_key(x, key = character(0), na_distinct = FALSE, x_name = NULL)
The object to check.
A character vector of the columns that represent a unique key.
A flag specifying whether missing values should be considerd distinct.
A string of the name of object x or NULL.
An informative error if the test fails.
Other check:
check_data()
,
check_dim()
,
check_names()
,
check_values()
# NOT RUN {
x <- data.frame(x = c(1, 2), y = c(1, 1))
check_key(x)
try(check_key(x, "y"))
# }
Run the code above in your browser using DataLab