search for: localfun

Displaying 1 result from an estimated 1 matches for "localfun".

Did you mean: localfun1
2011 Apr 06
1
Use of the dot.dot.dot option in functions.
Hi R users: I try this code, where "fun" is a parameter of a random generating function name, and I pretend to use "..." parameter to pass the parameters of different random generating functions. What am I doing wrong? f1<-function(nsim=20,n=10,fun=rnorm,...){ vp<-replicate(nsim,t.test(fun(n,...),fun(n,...))$p.value) return(vp) } This works! f1()