Entering edit mode
9.6 years ago
MAPK
★
2.1k
Hi guys,
I have R programming question: I have more than 1000 genes names Names
. I want to match the samples containing those genes in Names
and paste the corresponding gene with the ".AD" extension next to it in the same order to get the Result
as shown below. Thank you.
Names <- c("cebi", "pithe", "MAPK", "sapiens", "JUNK", "calli", "STR")
samples <- c("MAPK", "JUNK", "STR")
Result
:
"cebi", "pithe", "MAPK", "MAPK.AD", "sapiens", "JUNK", "JUNK.AD", "calli", "STR", "STR.AD"
Thank you, this is what I need.