Question: (Closed) R merge columns in the same file with identical column names and remove duplicates
0
gravatar for Seigfried
5 days ago by
Seigfried30
Seigfried30 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
C

This should give

horse   sheep
A          A
B
C

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 • 117 views
ADD COMMENTlink modified 5 days ago • written 5 days ago by Seigfried30

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.

Cheers!

ADD REPLYlink written 5 days ago by Ram12k

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 5 days ago by Seigfried30

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 5 days ago by Ram12k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

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