Re: [R] How to look within .Internal ?

From: Duncan Murdoch <>
Date: Wed, 19 Nov 2008 10:27:38 -0500

On 11/19/2008 10:13 AM, megh wrote:
> In the optim() function there is a syntax :
> res <- .Internal(optim(par, fn1, gr1, method, con, lower,
> Here how can I see the inside-codes of ".Internal" function ?

You need the R source code. Then find src/main/names.c, and look up "optim". It will tell you the C name of the function being called.

In this case, for the R-devel version, you'll find this on names.c line 853:

{"optim", do_optim, 0, 11, 7, {PP_FUNCALL, PREC_FN, 0}},

So you need to find the do_optim function. It's in src/main/optim.c.

You can browse these source files on

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 19 Nov 2008 - 15:30:15 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 Sun 07 Dec 2008 - 18:30:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive