[R] Proper way to implement package internal functions

Bryan Hanson hanson at depauw.edu
Thu Jun 13 01:13:33 CEST 2013

Hi Rolf...  Thanks.  I discovered the approach you described by looking at the source for spatstat, which as it turns out does exactly that.  I also discovered by testing that if you don't export a pattern, but rather export the specific names, not including the functions one wants to hide, that the warning goes away.  Since it is less work to change the export statement compared to even a minimal Rd, that's the way I went.  It's interesting that there is not more info about these options available.  Thanks, Bryan

On Jun 12, 2013, at 6:46 PM, Rolf Turner <rolf.turner at xtra.co.nz> wrote:

> On 13/06/13 03:34, Bryan Hanson wrote:
>    <SNIP>
>> So this warning from check is not a problem in the long run:
>> * checking for missing documentation entries ... WARNING
>> Undocumented code objects:
>>   ‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ...
>> All user-level objects in a package should have documentation entries.
>> if I understand correctly.  I guess the reason I didn't find any documentation is the wide lattitude which is possible.
> I think you *might* get flak about the warnings if you submit your package
> to CRAN.  I find such warnings annoying, anyhow.
> To avoid them you can create a *.Rd file listing all the undocumented functions
> in your package with an alias for the name of each such function and a
> "usage" line for each such function.  Only a mild pain in the pohutukawa,
> and it only needs to be done once.  (Possibly with some updating if new
> undocumented functions are added to the package.)
> The *.Rd file can be called anything you like (as long as it ends in ".Rd" and
> doesn't conflict with other *.Rd filled.  However a fairly common convention
> is to name the file "melvin-internal.Rd" where "melvin" is the name of your
> package.
>    cheers,
>        Rolf Turner

More information about the R-help mailing list