This function checks if there are any duplicate rows in the provided dataframe. If there are duplicate rows, a message is added to the provided collection.

check_no_duplicate_rows(dataframe, collection, unique_columns = NULL)

Arguments

dataframe

A dataframe.

collection

A list to store the message if there are duplicate rows.

unique_columns

Default is NULL. If provided, these are the columns to check for uniqueness.

Value

The updated collection.

Examples

# Create a dataframe with some duplicate rows
dataframe <- data.frame(a = c(1, 1, 2), b = c(2, 2, 3))
collection <- checkmate::makeAssertCollection()
check_no_duplicate_rows(dataframe, collection, c("a", "b"))
#> Collection of 1 assertion.