Skip to content

dynamics of functions

2 messages · Ravi Varadhan, Tobias Verbeke

#
Here is a recursive function.

iterate <- function(f, n, x){
 if(n==0) return(x)
 iterate(f, n-1, f(x))
}

iterate(function(x) 1/(1+x), 10, 1)

Best,
Ravi.

----- Original Message -----
From: Tobias Verbeke <tobias_verbeke at skynet.be>
Date: Thursday, June 5, 2003 12:04 pm
Subject: Re: [R] dynamics of functions
#
Thanks to you all for the
clarifications.
I will work on my spacebar usage ;-)

Regards,

Tobias