Try this:

 > library(gplots)
 > x <- as.matrix(USArrests)
 > hc <- hclust(dist(USArrests), "ave")
 > dend1 <- as.dendrogram(hc)
 > heatmap.2(x, Rowv=dend1)

-G

On May 16, 2008, at 12:23PM , Jeremiah Rounds wrote:

>
> > To: r-help@stat.math.ethz.ch> From: johannes_graumann@web.de>  
> Date: Fri, 16 May 2008 17:55:26 +0200> Subject: [R] heatmap on pre- 
> established hclust output?> > Hi,> > Can someone please guide me  
> towards how to produce "heatmap" output from the> output of  
> "hclust" run prior to the actual "heatmap" call? I have some>  
> rather lengthy clustering going on and tweeking the visual output>  
> with "heatmap" recalculating the clustering every time is not  
> feasible.> > Thanks, Joh
>
> I can't say that i have actually tackled this, but I have some  
> experience with the functions you mentioned.  Heatmap takes an  
> hclustfun function parameter.  You can create a custom clustering  
> function.  I don't believe there is a rule that says you have to do  
> actual work in that function call.  Look at just returning the  
> results of your more complicated clustering in that call without  
> actually doing the calculations.
>
> Jeremiah Rounds
> Graduate Student
> Utah State University
>
> > > ______________________________________________> R-help@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.
> _________________________________________________________________
> E-mail for the greater good. Join the i’m Initiative from Microsoft.
>
> ood
>         [[alternative HTML version deleted]]
>
>
> <ATT4398153.txt>

Gregory R. Warnes, Ph.D.
Associate Professor
Center for Biodefence Immune Modeling
    and
Department of Biostatistics and Computational Biology
University of Rochester





	[[alternative HTML version deleted]]

