Skip to content
Prev 4862 / 398506 Next

evaluation is nested too deeply: infinite recursion?

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.