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

2010-03-09 Thread Seeker
t; >> or if x is a length 1 vector then even simpler: > > >> set.seed(123) > >> x<- rnorm(1) > >> n<- 5 > > >>   x^(1:5) * exp(-x) > > >> But we still do not know if this is really the

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

2010-03-05 Thread Seeker
mean each time. > > On Mar 4, 1:31 pm, jim holtman wrote: >  > What exactly are you trying to do?  'foo' calls 'foo' calls 'foo' .... >  >  How did you expect it to stop the recursive calls? >  > >  > >  > >  > >  > &g

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

2010-03-04 Thread Seeker
ive calls? > > > > > > On Thu, Mar 4, 2010 at 2:08 PM, Seeker wrote: > > Here is the test code. > > > foo<-function(x) exp(-x) > > for (i in 1:5) > > { > > foo<-function(x) foo(x)*x > > foo(2) > > } > > > The e

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

2010-03-04 Thread Seeker
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. __ R-help@r-project.org mailing lis