Skip to content
Prev 256079 / 398506 Next

Two functions as parametrs of a function.

Try this:

f2 <- function(n, nsim, fun1, fun2) {
	vp <- replicate(nsim, do.call(fun1$name, c(n, fun1$args)),
				    do.call(fun1$name, c(n, fun1$args)))
	vp

}

f2(2, 100, fun1 = list(name = rbeta, args = list(shape1 = 2, shape2 =
2), fun1 = list(name = rbeta, args = list(shape1 = 2, shape2 = 2))))

On Thu, Apr 7, 2011 at 8:45 AM, Kenneth Roy Cabrera Torres
<krcabrer at une.net.co> wrote: