On doing different joins using "a.*" the columns with same name are also getting adjoined to the main dataset. I need a way to either remove the duplicate columns or not join them at the first place. It would be not be possible to indicate all the variables in the second table as I need a custom function for joining 2 datasets
Asked
Active
Viewed 576 times
-2
-
you can just rename them so they have the same name, then they will not be duplicated i guess – Orhan Yazar Aug 02 '17 at 11:17
-
1Please review [mcve]. – G. Grothendieck Aug 02 '17 at 13:06
1 Answers
0
I believe this subsets the data set.
data <- data[ , !duplicated(colnames(data))]
So, essentially, this should work fine.
x <- x[ !duplicated(names(x)) ]

ASH
- 20,759
- 19
- 87
- 200