Re: [R] how to get code of a .Internal() function?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Wed 20 Apr 2005 - 22:44:28 EST

This is really an R-devel question, but R-help readers may have wondered about this.

Alban wrote:
> Hello,
>
> I'm working with the function optim() from stats
> package,
> and inside this function is called the function
> .Internal(optim(....)) and I want to get the code of
> this function which would help me to understand why
> the Nelder-Mead algorithm doesn't converge with my
> data.
> I'm working under Windows XP.
> Could you reply to this adress because I don't belong
> to the mailing list
> Thank you very much!!!

.Internal functions are written in C. Many users won't have the C source installed; you'll need to go to CRAN to get it.

The source for .Internal functions is usually (always?) somewhere in the src/main subdirectory of the source tree. You find it by looking up the identifier in src/main/names.c, finding this line:

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

which tells you that the do_optim routine handles this stuff. Further searches would show you that this function is defined in src/main/optim.c.

Duncan Murdoch



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Apr 20 22:51:56 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:17 EST