[R] Two functions as parametrs of a function.

From: Kenneth Roy Cabrera Torres <krcabrer_at_une.net.co>
Date: Thu, 07 Apr 2011 06:45:13 -0500

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:



    localfun1 <- function() fun1(n, p1)
    localfun2 <- function() fun2(n, p2)
    vp<-replicate(nsim,t.test(localfun1(), localfun2())$p.value)     return(vp)


Thank you for your help.


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 07 Apr 2011 - 11:47:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Apr 2011 - 12:20:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive