View source: R/check_duplicates.R
check_duplicates | R Documentation |
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.
check_duplicates(data, columns)
data |
A data frame. |
columns |
A character vector of column names. |
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 frame
df <- 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 columns
check_duplicates(df, c("a", "b"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.