[R] Arguments of R- and C-side of internal functions

Timur Elzhov Timur.Elzhov at jinr.ru
Fri Jan 17 16:11:03 CET 2003


Dear R experts,

I looked at the body of, say, `optim' function and found
the call to the `.Internal', C optim function. It looks
like this:

  .Internal(optim(par, fn1, gr1, method, con, lower, upper))

On the other hand, the C prototype of optim is:

  SEXP do_optim(SEXP call, SEXP op, SEXP args, SEXP rho);

So, I guess that all the list of parameters passing in R are assigned
to `args', right?

First, how is that implemented?  I looked at the `.Call()' - as I
  understand, it requires for C-side the same number of parametrs
  (minus the function name to be called); and `.External()' - it
  wants the single list.
Second, who pass the other, `call', `op' and `rho' parameters
  to `do_optim() ?'


Thank you!

  
--
WBR,
Timur




More information about the R-help mailing list