[R] Is it possible to recursively update a function?

Seeker zhongming at gmail.com
Thu Mar 4 20:08:25 CET 2010


Here is the test code.

foo<-function(x) exp(-x)
for (i in 1:5)
{
foo<-function(x) foo(x)*x
foo(2)
}

The error is "evalution nested too deeply". I tried Recall() but it
didn't work either. Thanks a lot for your input.



More information about the R-help mailing list