I have a data.frame containing many duplicated columns, for example:
df = data.frame(a=1:10, b=1:10, c=2:11)
Is there a function (base R or dplyr) that removes duplicated columns ? unique()
removes duplicate rows.
Unlike How to remove duplicated column names in R? my columns already have different names, but the values are identical.