From murdoch at stats.uwo.ca  Mon Jul  6 13:13:14 2009
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Mon, 06 Jul 2009 07:13:14 -0400
Subject: [Rd] [R] problem with internal functions in Windows
In-Reply-To: <4A51E4FA.5572.00B2.1@lshtm.ac.uk>
References: <4A51E4FA.5572.00B2.1@lshtm.ac.uk>
Message-ID: <4A51DC4A.3080000@stats.uwo.ca>

This is more of an r-devel topic, so I've sent my reply there.

On 06/07/2009 6:50 AM, Antonio.Gasparrini at lshtm.ac.uk wrote:
> Dear R users,
>  
> I included 2 internal functions in the package 'dlnm', called 'mkbasis' and 'mklagbasis'.
> Despite they are not meant to be called by the users, I included them in the namespace in order to make them available, keeping the process more transparent and giving the opportunity to change or improve them.

The usual reason to make something an internal function is so that you 
feel no obligation to maintain the interface.  If it is in the 
NAMESPACE, you should feel guilty whenever you make incompatible changes.

Another reason to keep them internal is that they don't really fit with 
the goals of your package:  they are just a distraction.  You don't want 
people to use your package just for those things.  (This is actually the 
same reason as the first: the reason you don't want your package to be 
used for some little utility function is that you would drop it if it 
showed up in a base package.)

So if you think those functions are useful and on target, and you don't 
foresee changing them, then exporting them is reasonable.

> I included an help page 'dlnm-internal.Rd' to document them, and some examples in a package vignette I want to add.
> The problem is that the link to this help page doesn't work in the version installed by the CRAN (eg. try ?mkbasis).
> I checked the help pages for internal functions in other packages: some of them work (e.g. ?geepack::anova.geeglm), others don't (e.g. ?gam::.First.lib).
>  
> Any suggestions?

Did you set aliases in the help pages?  Those are what help uses to find 
the page.

And what OS and R version are you using?  ?gam::.First.lib works for me 
(on Windows, with 2.9.0 or 2.9.1 patched).

Duncan Murdoch



[Rd] [R] problem with internal functions in Windows
Duncan Murdoch