check_duplicates: Check for Duplicate Rows in Selected Columns
Description
This function checks if there are any duplicate rows in the specified columns of a data frame.
It prints the unique rows and returns a boolean indicating whether the number of rows in the original data frame is the same as the number of rows in the data frame with duplicate rows removed.
Usage
check_duplicates(data, columns)
Value
A logical value indicating whether the number of rows in the original data frame is the same as the number of rows in the data frame with duplicate rows removed.
# Create a data framedf <- data.frame(a = c(1, 2, 3, 1), b = c(4, 5, 6, 4), c = c(7, 8, 9, 7))
# Check for duplicate rows in the first two columnscheck_duplicates(df, c("a", "b"))