0

here is my script:

heatmap.2(
as.matrix(data[,2:7]), 
trace="none",
dendrogram="row", 
cexRow=0.5, cexCol=0.95,
)

The gene names appear as numbers as I excluded the first column that contains gene names. How can I replace the numbering by gene names?

Many thanks

Kaur
  • 11
  • 1
  • If you could provide a sample of the data with `dput` so we could experiment I am certain the problem would be resolved much faster. [Suggested reading](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – missuse Dec 06 '17 at 11:17

1 Answers1

1

if you have a matrix object (named m) and a vector of genes (named g), you can add row names like this:

rownames(m) <- g

you can similarly add the names of columns:

colnames(m) <- vector

then you can re-plot the heatmap of matrix m

Hope this helps. Cheers!