From simon.urbanek at r-project.org  Thu May 24 18:58:15 2012
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Thu, 24 May 2012 12:58:15 -0400
Subject: [Rd] modifying some package code
In-Reply-To: <CAOLJphnqTt-Dut24cShJ4iZQ5NwAy1WkmL9bKSn7dm3yEDmc_w@mail.gmail.com>
References: <CAOLJphnqTt-Dut24cShJ4iZQ5NwAy1WkmL9bKSn7dm3yEDmc_w@mail.gmail.com>
Message-ID: <60EE8CD6-1214-47D8-ADF3-3E6B5F125C2A@r-project.org>


On May 24, 2012, at 12:25 PM, Charles Determan Jr wrote:

> Greetings,
> 
> I am working on modifying some code from the nlme package.  I have had many
> discussions on the mixed models mailing list and have been directed to
> simply 'hack' the source code to have the degrees of freedom generated by
> one function to use in the output of another function that doesn't generate
> them.  My current holdup is an error regarding a .c file called
> 'inner_perc_table' called by the .C function.  The error states that the
> object 'inner_perc_table' is not found.  My confusion lies in the fact that
> when I run the original script, it recognizes the part just fine.  At no
> point is the object defined and I cannot currently find such a code in the
> package's source.  Perhaps someone here is familiar with the nlme package
> and could assist me in some form.  If you need further information, please
> ask as I don't know if there is a general answer for this type of question
> or if you will need the actual code.
> 

The (unexported) object contains cached reference to the native function (see ?getNativeSymbolInfo) and is defined by R_registerRoutines in src/init.c. This is a typical optimization in R packages to avoid costly lookup of symbols and to provide check for native arguments.

Cheers,
Simon



[Rd] modifying some package code
Simon Urbanek