[R] Functions in a package not visible to a user

Paul Roebuck roebuck at odin.mdacc.tmc.edu
Fri Jul 16 17:43:16 CEST 2004


On Thu, 15 Jul 2004, Andy Liaw wrote:

> Rui Dantas wrote:
>
> > I have a package with several R functions. Some are internal auxiliary
> > functions, and should not be available to the user (nor do they, for
> > example, need "user" documentation). How can I hide them?
>
> That's one of the purposes of the namespace.  See Prof. Tierney's article in
> the R Newsletter, or the slides of his keynote lecture at the useR! 2004
> conference.  It's also explained in the `Writing R Extensions' manual.
> Basically you only export functions that the users should see.  The manual
> also explains how to not document functions that aren't intended to be
> called by users.

Am I the only one who finds the namespace still too limited?
It still lacks the middle ground of being able to have only
package level access without declaring functions public.

I also found the suggested documentation standard for private
functions too limiting. I modified the R-ext 1.1.4 recommendation
for my package to use multiple '<function>-internal.Rd' instead of
a single '<package>-internal.Rd'; this allowed me to document the
disparate functions with logical grouping rather than using the
suggested "bag" approach.

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)




More information about the R-help mailing list