Skip to content

evaluation is nested too deeply: infinite recursion?

2 messages · Mathieu Ros, Brian Ripley

#
hello R-users,
I'm trying to port from S+4 a library called S2HTML.
generic function HTMLExport, when called for a lm object, uses
HTMLExport.lm which itself calls HTMLExport.list to export the summary.
My problem is that HTMLExport.list may itself call HTMLExport (and so
HTMLExport.list) for  components of the lists that are lists themselves
(like "terms" component of an lm object).
I get the following error message in this case :
Error in as.vector(x) : evaluation is nested too deeply: infinite
recursion?
I believe this error is due to a too deep recursion but maybe there is a
way to overcome this error (shouldn't it be a warning?).
I would be very grateful if anybody could help me or give me a hint.
thanks,
    Mathieu
PS : code of these functions is in my last 2 mails.


--
------------------------------------------------------------------
Mathieu Ros                   |             Sigma+
http://mathieu.ros.free.fr/   |    http://www.sigmaplus.fr
DESS ing?nierie math?matique  |  5 place st pierre, Toulouse
    (biostatistiques)         |
------------------------------------------------------------------
l'exp?rience est le nom que chacun donne a ses erreurs. Wilde


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20000315/6719f252/attachment.html
#
On Wed, 15 Mar 2000, Mathieu Ros wrote:

            
It should be an error. You do want it to stop before you do too much
damage. S behaves in the same way. You can change the limit by setting an
option: see ?options and look for `expressions'. (This option was put there
on all platforms after a couple of examples of crashes caused by
over-running OS structures such as the process stack.)

The default limit in R is higher than that in S-PLUS, at least on the
versions I have.
You could try dumping the frames and examining the state when it does
give you an error.  It is very unlikely that you should be getting 
a nesting 500 deep, but it is possible that R is `leaking' levels
(we have corrected one such bug fairly recently).  About the only examples
in S where the limit needs to be increased involve symbolic manipulations
such as symbolic differentiation.