From simon.urbanek at r-project.org  Thu May 24 20:14:08 2012
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Thu, 24 May 2012 14:14:08 -0400
Subject: [Rd] modifying some package code
In-Reply-To: <CAOLJphmC+xL2MPL1rt9gM_+S6WQ9uyRUTorraifgnXHh7QR7wQ@mail.gmail.com>
References: <CAOLJphnqTt-Dut24cShJ4iZQ5NwAy1WkmL9bKSn7dm3yEDmc_w@mail.gmail.com>
	<60EE8CD6-1214-47D8-ADF3-3E6B5F125C2A@r-project.org>
	<CAOLJphmC+xL2MPL1rt9gM_+S6WQ9uyRUTorraifgnXHh7QR7wQ@mail.gmail.com>
Message-ID: <499C64C3-9D55-46E2-ACB2-07C3CD929037@r-project.org>

On May 24, 2012, at 1:26 PM, Charles Determan Jr wrote:

> Simon,
> 
> Thank you for this valuable information.  However, you must forgive some ignorance on my part.  If R-registerRoutines defines the native function, how should I go about fixing this issue?  Would I copy the init.c to the base package (where I have the new function)?
> 

I'm not sure what *is* your issue. nlms:::inner_perc_table is defined (automatically), so it just works. If you are re-using just the .C part of nlme somewhere else that you dyn-load manually then you can simply use "inner_perc_table" instead.

Cheers,
Simon


> On Thu, May 24, 2012 at 11:58 AM, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> 
> 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