I have the following like data in a tab-delimted text file named original
Name Symbol Value
abcd A 56
de45 C 67
ji98 H 90
k9ug K 43
phzt L 98
prex P 21
kadf T 32
Also I have list of selected Symbols stored in another tab delimited text file named duplicate
Symbol Description
K Intel
P Diary
C Cape
S Sheath
A Aim
I want to extract the rows from original file which has same Symbol with duplicate. I want my output like the following:
Name Symbol Value
abcd A 56
de45 C 67
k9ug K 43
prex P 21
I tried using the following code but some how I could not get any results or only the row of A. Here is the code which I have used
result <- original[original$Symbol %in% duplicate$Symbol,]
Could anyone please help me.
duplicatedataframe beSymbol, notsymbol?