I would like to keep duplicate columns, and delete columns that are unique. The columns would have same values, but different names.
x1 = rnorm(1:10)
x2 = rnorm(1:10)
x3 = x1
x4 = rnorm(1:10)
x5 = x2
x6 = rnorm(1:10)
x7 = rnorm(1:10)
df = data.frame(x1,x2,x3,x4,x5,x6,x7)
From here I would keep columns x1, x2, x3, and x5.
There is also a similar question for python: Get rows that have the same value across its columns in pandas