Question: (Closed) R merge columns in the same file with identical column names and remove duplicates
gravatar for Seigfried
12 months ago by
Seigfried60 wrote:

Dear all

I have a dataframe containing columns with identical names for some reason. I wish to combine these columns with the same name with removing the duplicates

I tried using merge but I do not want to enter the column names one by one like merge (x, y)

horse   sheep   horse
A          A    A
B               B

This should give

horse   sheep
A          A

Is there any way to do this? I googled and found ways to do it 1 by 1 but I have a lot of columns

R • 1.4k views
ADD COMMENTlink modified 12 months ago • written 12 months ago by Seigfried60

Hello Seigfried!

We believe that this post does not fit the main topic of this site.

Not bioinformatics. Please search SO

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.


ADD REPLYlink written 12 months ago by RamRS19k

Thank you for the reply

In my case my terms were basically GO terms which I wanted to reduce (1->3)-beta-D-glucan metabolic process (1->3)-beta-D-glucan metabolic process acetyl-CoA metabolic process fksA fksA AN3817 rhoA rhoA AN3869 sunA sunA AN4923 gelA facA

ADD REPLYlink written 12 months ago by Seigfried60

It was not apparent in the original post. Please edit it and add in relevant information and I'll reopen the question.

ADD REPLYlink written 12 months ago by RamRS19k
Please log in to add an answer.
The thread is closed. No new answers may be added.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1014 users visited in the last hour