[R] Proper way to implement package internal functions

Rolf Turner rolf.turner at xtra.co.nz
Thu Jun 13 00:46:01 CEST 2013


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