[R] row labels in heatmap.2(package gplots)

David Winsemius dwinsemius at comcast.net
Tue Nov 25 21:30:08 CET 2008


I could not tell from the help file whether rotation of the x labels  
is supported in heatmap.2. I did read (perhaps in one of the linked to  
help files)  that rotation  was only allowed with "text" and I was  
left wondering if it might be possible to use text(x) and list(rot=90)  
as arguments to a scales call.

At any rate, the results of this worked levelplot example from  
Sarkar's text is worth considering:

data(Cars93, package="MASS")
library(lattice)
  cor.Cars93 <- cor(Cars93[, !sapply(Cars93, is.factor)], use ="pair")
  levelplot(cor.Cars93,  scales =list(x=list(rot=90)))

-- 
David Winsemius

On Nov 25, 2008, at 2:19 PM, Jun Ding wrote:

> Dear R users,
>
> I have a question regarding how to make row labels readable in a  
> heat map.
>
> I have successfully made a heat map using function "heatmap.2" in  
> the package "gplots". However, as there are many rows in the heat  
> map, I have difficulties labeling them (heatmap.2 provides a  
> parameter "labRow" to label the row names, but as I have too many  
> rows, I can not make them readable). Do you have any suggestions to  
> improve the labeling?
>
> I am thinking about using multiple columns to label the row names  
> instead of one column(the default in heatmap.2). I have tried to use  
> "mtext" to write texts on the margin of the heat map, but it could  
> not work either. Do you think this can work? How can I know the  
> coordinates of each row in a heat map?
>
> Thank you very much!
>
> Jun
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list