Re: [R] NAMESPACE vs internal.Rd

From: Berwin A Turlach <berwin_at_maths.uwa.edu.au>
Date: Wed, 16 Jul 2008 21:48:13 +0800

G'day Christophe,

On Wed, 16 Jul 2008 15:10:05 +0200
cgenolin_at_u-paris10.fr wrote:

> Hi the list,
>
> When we use package.skeleton, it create some file in the man
> directorie. - If we use package.skeleton with namespace=FALSE, it
> create a file toto-internal.Rd
> - If we use package.skeleton with namespace=TRUE, it does not create
> the file toto-internal.Rd
>
> Why is that ?

My understanding from my reading of "Writing R Extension is" :

  1. All functions/objects of a package that a user can call/see have to be documented in order for the package passing "R CMD check" without warnings/errors.
  2. Users can see all functions/objects in packages without a namespace, hence everything has to be documented. For functions that you do not want users to call directly, since they are help functions for the "main" functions of your package", you can just create entries in internal.Rd (or toto-internal.Rd) without writing a "complete" help page for these functions. "R CMD check" will accept this as documentation.
  3. In packages with a namespace, you decide which function/objects the user can see by exporting them. Everything not exported is supposed to be internal to the package and should not be accessed directly by users (though they can via :::). Functions/objects that are not exported do not need to be documented, hence no need for the toto-internal.Rd stub.

HTH (and HTIC).

Cheers,

        Berwin


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 16 Jul 2008 - 13:53:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jul 2008 - 15:31:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive