1

I am very new to R, and this might be a silly question, but I appreciate any help in advance.

I have a large data frame named df_long0 with a column titled Gene.names. I have another matrix titled annotLookup with two columns: gene and ensembl. I need to match df_long0$Gene.names with the Ensembl IDs from annotLookup$ensemble. I tried using the match() function, but I don't have enough experience to know what it meant or what to do with it.

Here is an example of what I have:

annotLookup
| gene | ensembl |
| -------- | ------------------ |
| Tslp     | ENSMUSG00000024379 |
| Pcsk9    | ENSMUSG00000034139 |

 df_long0
| Gene.names |
| ------- |
| Pcsk9   |
| Tslp    |

How can I match it up so I can add the annotLookup$ensembl column next to df_long$Gene.names?

  • Please share your data using `dput(head(YOURDATA)`. Edit your question and put the `structure`-output from `dput` into your question. – Martin Gal Jul 08 '21 at 20:39

0 Answers0