Hi guys, I have two very large gene data sets, and I want to extract all the matching values that are in the two lists.
but I haven't been successful until now,
so far this is my code
list1 = ("1_10.txt")
list2 = ("1_10.txt")
ID <- match(list1,list2)
result1 <- list2[na.omit(ID)]
unique(result1)
write.csv(ID,file="matchedresults1.txt")
list1
EnsemblGeneID
ENSG00000109573
ENSG00000205003
ENSG00000124603
ENSG00000008313
ENSG00000183043
ENSG00000179863
ENSG00000141337
ENSG00000154257
list2
EnsemblGeneID
ENSG00000109573
ENSG00000205003
ENSG00000124603
ENSG00000008313
ENSG00000183043
ENSG00000179863
ENSG00000141338
ENSG00000154258
So I expected that see the extracted data:
list3
EnsemblGeneID
ENSG00000109573
ENSG00000205003
ENSG00000124603
ENSG00000008313
ENSG00000183043
ENSG00000179863
thanks for reading
intersect()
Hi there, I have a long list of genes in two files.
Let me try your script
Nicky : Please use
ADD COMMENT/ADD REPLY
when responding to existing posts to keep threads logically organized.SUBMIT ANSWER
is for new answers to original question.