iter: Turn a function into an iterated mapping

Description Usage Arguments Value Author(s) See Also Examples

Description

Given a function f, return g such that g(x,k) = f^k (x) = f(f(f(f(...f(x)))))

Usage

1
iter(f)

Arguments

f

a function

Value

g another function

Author(s)

Simon Barthelme

See Also

fp (for fixed points), viewer (for viewing intermediate results), store (for storing them)

Examples

1
2
3
4
5
6
7
f <- function(x) x*2
g <- iter(f)
g
g(3,nIter=2)  ## Corresponds to:
f(3) %>% f
g(3,nIter=3) ## Corresponds to: 
f(3) %>% f %>% f

dahtah/fixedpoints documentation built on May 14, 2019, 3:25 p.m.