Thank you very much, patelk26. Indeed, is very nice that I can do it with R, because I am working with it so I don't have to mix different languages or do things outside in the terminal to introduce again in R.
I just had to add as.vector(), because my data actually is introduced differently, but it works perfectly! Here is the final code:
annot <- NULL
annot$ENSEMBL <- rownames(featureCounts)
annot$SYMBOL <- mapIds(EnsDb.Mmusculus.v79, keys=rownames(featureCounts), column="SYMBOL",keytype="GENEID")
annot$SYMBOL1 <- mapIds(org.Mm.eg.db, keys = rownames(featureCounts), column = 'SYMBOL', keytype = 'ENSEMBL', multiVals = 'first')
annot <- as.data.frame(annot)
consensus <- data.frame('Symbol'=ifelse(!is.na(annot$SYMBOL), as.vector(annot$SYMBOL),
ifelse(!is.na(annot$SYMBOL1),as.vector(annot$SYMBOL1), as.vector(annot$ENSEMBL))))
annot$consensus <- consensus
Thanks again.
