Re: [R] Re : Half of a heatmap

From: Gavin Kelly <>
Date: Mon, 25 Jun 2007 17:24:22 +0100

 > I am trying to produce a heatmap of pairwise correlations, but since the matrix is
> symmetric, I only need either the upper or the lower triangle. I have scoured the
> web and R documentation, but I have not been able to find a way to produce such a
> figure. Is there a simple way to produce a heat map with only the part above or
> below the diagonal?

Can you not just set the lower or upper triangle to NAs, and pass this on to heatmap - or am I misunderstanding you?

tmp <- matrix(rnorm(100),10,10)
tmp[lower.tri(tmp)] <- NA
heatmap(tmp, Rowv=NA, Colv=NA)

Regards - Gavin

Gavin Kelly
Senior Statistician, Bioinformatics & Biostatistics Group
Cancer Research UK

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 25 Jun 2007 - 16:37:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Jun 2007 - 17:32:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.