-2

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

Ankit Haldar
  • 115
  • 1
  • 2
  • 8

1 Answers1

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