Hi everyone!
I have 2 files and I want to compare the Ensembl Gene Ids in my input file to Ensembl Gene Ids in the 2nd file (library file) and write those Ids from my input file that match to the library into a third file (output file) using R. My files look like this:
INPUT FILE:
sample_1 sample_2 log2.fold_change. test_stat p_value q_value significant EnsemblGeneId GeneName
Plac8-9 Plac11-12 0.610342 -3.34003 0.00083 0.02840 yes ENSGALG00000006409 PODXL
LIBRARY FILE:
Ensembl Gene ID Ensembl Transcript ID Ensembl Protein ID Associated Gene Name Associated Gene Name
ENSGALG00000000168 ENSGALT00000000224 ENSGALP00000000223 AA1R_CHICK AA1R
I would like the entire row of matched Ensembl ID from the input file to be written to the output file. Ive looked at match but it doesn't do what I want. Many thanks!!!
Another variation:
Nicely shortened. You don't even need the which(), though, if you really want to go minimalist.
Thanks a lot!!! works like a charm!