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

From: Paul Roebuck <roebuck_at_odin.mdacc.tmc.edu>
Date: Sat 17 Jul 2004 - 01:43:16 EST

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)

R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 17 01:50:39 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:03 EST