[Rd] row-side color bars do not reverse properly in heatmap (PR#7972)

From: <krc_at_odin.mdacc.tmc.edu>
Date: Mon 27 Jun 2005 - 19:55:37 GMT


Full_Name: Kevin R. Coombes
Version: 2.1.0
OS: Windows XP
Submission from: (NULL) (143.111.224.169)

When revC = TRUE and RowSideColors is set to a list of colors in heatmap, then the image and dendrogram are inverted, but the row-side color map does not change. The following script illustrates the problem.

##############

set.seed(1023)
# generate columns of two different types
d1 <- matrix(rnorm(100*6, rnorm(100, 0.5)), nrow=100, ncol=6, byrow=FALSE) d2 <- matrix(rnorm(100*4, rnorm(100, 0.5)), nrow=100, ncol=4, byrow=FALSE)
# join them together

dd <- cbind(d1, d2)
# label them with different colors

cols <- rep(c('blue', 'green'), times=c(6,4))

# change the order of the columns and the matching labels
# to show that reordering occurs in one case in heatmap
col.order <- sample(10)
dd <- dd[, col.order]
cols <- cols[col.order]

# compute the dendrogram to be used in the display
hc <- hclust(dist(dd, 'euclid'))

# get the correlation matrix

m <- cor(dd)

# this version works correctly

heatmap(m, Rowv=as.dendrogram(hc), symm=TRUE, revC=FALSE,

        RowSideColors=cols)
#this version reverses the dendrogram and image, but not the colors
heatmap(m, Rowv=as.dendrogram(hc), symm=TRUE, revC=TRUE,

        RowSideColors=cols)



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Jun 28 05:57:22 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:27:22 GMT