$ R
probename <- c("A","B","C","D","E")
probename
[1] "A" "B" "C" "D" "E"
genename <- c("gene1","geen2","gene3","gene4","gene5")
genename
[1] "gene1" "geen2" "gene3" "gene4" "gene5"
annotationlist <- cbind(probename, genename)
annotationlist
probename genename
[1,] "A" "gene1"
[2,] "B" "geen2"
[3,] "C" "gene3"
[4,] "D" "gene4"
[5,] "E" "gene5"
class(annotationlist)
[1] "matrix"
annot <- as.data.frame(annotationlist)
annot
probename genename
1 A gene1
2 B geen2
3 C gene3
4 D gene4
5 E gene5
class(annot)
[1] "data.frame"
annot$probename
[1] A B C D E
Levels: A B C D E
difgenes <- c("A", "E")
difgenes
[1] "A" "E"
annot[annot$probename == "A",]
probename genename
1 A gene1