This function takes a data frame as input and checks for duplicate columns. A column is considered a duplicate of another column if all values in both columns are the same. If any duplicate columns are found, the function prints a message indicating which columns are duplicates of which other columns. If no duplicate columns are found, the function prints a message indicating that no duplicates were found.

find_duplicate_cols(df)

Arguments

df

A data frame

Value

A message indicating which columns are duplicates of which other columns

Examples

df <- data.frame(w = c(7, 8, 180, 7), x = c("a", "b", "c", "a"),
                 y = c(4, NA, -6, 4), z = c(7, 8, 180, 7))
find_duplicate_cols(df)
#> Duplicate columns found:
#> Column 'z' is a duplicate of column 'w'
# Column 'c' is a duplicate of column 'a'