[R] error "evaluation nested too deeply" {was "Heatmap"}

Martin Maechler maechler at stat.math.ethz.ch
Sat Jan 3 13:47:14 CET 2004


I'm diverting this to the more appropriate mailing list, R-help,
since heatmap() is standard R function.

>>>>> "Johan" == Johan Lindberg <johanl at kiev.biotech.kth.se>
>>>>>     on Fri, 02 Jan 2004 10:04:14 +0100 writes:

    Johan> I am trying to plot a matrix of m-values in a heatmap
    Johan> with "average linkage". The rows are M-values of
    Johan> genes and the columns are my slides.  I do the
    Johan> following and get the following error message:

    >> heatmap(Matrix[,],Rowv=as.dendrogram(gclus),Colv=as.dendrogram(sclus),col=rbg)

    Johan>  Error in match.fun(FUN) : evaluation is
    Johan> nested too deeply: infinite recursion?  Error:
    Johan> evaluation is nested too deeply: infinite recursion?

The problem happens when trying to plot a large dendrogram.
The "dendrogam" class is implemented as an S-level "tree", i.e.,
a nested list  and plot.dendrogram() uses recursion for
plotting.

To avoid infinite recursion (which would typically "freeze" your
computer), there's a limit in R (and S),
	   options(expressions = 500)

for how deeply recursions are allowed
to go.  The limit is currently too low for the typical
dendrograms that people consider in microarray analysis of
several thousand genes.
Setting
	options(expressions = 10000)
should solve the problems for these data sizes.

[when replying to this, please do *drop*  bioconductor at .. now;  it's a n R topic]

Regards,
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list