# Create a dataframe with a unique ID column
data_frame <- tibble::tibble(
id = c(1, 2, 3, 4, 5),
value = c("a", "b", "c", "d", "e")
)
is_unique_column("id", data_frame) # Returns TRUE
# Create a dataframe with duplicate values in the ID column
data_frame <- tibble::tibble(
id = c(1, 2, 3, 4, 5, 1),
value = c("a", "b", "c", "d", "e", "a")
)
is_unique_column("id", data_frame) # Returns FALSE
Run the code above in your browser using DataLab