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
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
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
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
4 matches
Mail list logo