check_key | R Documentation |
Checks if columns have unique rows.
check_key(x, key = character(0), na_distinct = FALSE, x_name = NULL)
x |
The object to check. |
key |
A character vector of the columns that represent a unique key. |
na_distinct |
A flag specifying whether missing values should be considered distinct. |
x_name |
A string of the name of object x or NULL. |
An informative error if the test fails or an invisible copy of x.
Other check:
check_data()
,
check_dim()
,
check_dirs()
,
check_files()
,
check_names()
,
check_values()
x <- data.frame(x = c(1, 2), y = c(1, 1))
check_key(x)
try(check_key(x, "y"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.