[Rd] heatmap without dendrogams (PR#13512)

ligges at statistik.tu-dortmund.de ligges at statistik.tu-dortmund.de
Thu Feb 19 19:00:38 CET 2009



j.j.goeman at lumc.nl wrote:
> Full_Name: Jelle Goeman
> Version: 2.8.1
> OS: Win XP
> Submission from: (NULL) (87.212.67.197)
> 
> 
> I get the following error message when I try to make a heatmap (package stats),
> without the associated dendrograms.
> 
> X <- matrix(rnorm(200),20,10)
> XX <- crossprod(X)
> heatmap(XX, Rowv= NA, revC=TRUE)
> Error in rev(ddr) : object "ddr" not found
> heatmap(XX, Rowv= NA, sym=TRUE)
> Error in heatmap(XX, Rowv = NA, sym = TRUE) : object "ddr" not found
>  
> According to the help file, this should work; indeed it does if I set revC or
> sym to FALSE. Seems like ddr should be initialized to something like 1:ncol(X)
> for the no-dendrogram case.
> 
> Kind regards,
> 
> Jelle
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



Since it looks like nobody answered so far, let me suggest a patch:



D:\RCompile\recent\R\src\library\stats\R>diff -u  dendrogram.R 
dendrogram.R-new
--- dendrogram.R        2009-02-19 18:54:18.832062400 +0100
+++ dendrogram.R-new    2009-02-19 18:52:29.612961900 +0100
@@ -699,7 +699,7 @@
      x <- t(x)
      if(revC) { # x columns reversed
      iy <- nr:1
-    ddr <- rev(ddr)
+    if(doRdend) ddr <- rev(ddr)
      x <- x[,iy]
      } else iy <- 1L:nr



Best wishes,
Uwe Ligges



More information about the R-devel mailing list