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
?