[R] Question about do.call()

Tong Wang wangtong at usc.edu
Mon Sep 11 11:57:04 CEST 2006

    I'm writing a function f()  which includes probability density function computation,  I would like to make this generic, that is , I will specify  the density when I call f(),   here's what I wrote:  do.call(den, args=list(d, arg)) 
    the question is , say, if I let den=dnorm, I have to replace arg with  mean=??, sd=??, etc.  but I tried arg=c(mean=..,sd=..)
and arg="mean=..,sd=..",  neither of these worked.   What is the right way to do this ?

Thanks a lot


More information about the R-help mailing list