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 = rb
On 07/04/2011 7:45 AM, Kenneth Roy Cabrera Torres wrote:
Hi R users:
I'm trying to make a function where two of the parameters are
functions, but I don't know how to put each set of parameters for
each function.
What am I missing?
I try this code:
f2<-function(n=2,nsim=100,fun1=rnorm,par1=lis
2 matches
Mail list logo