[R] Question about do.call()

Tong Wang
Mon, 11 Sep 2006 09:57:04 -0000

Hi,
    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

tong