Skip to content

how to keep the documents of private functions private

3 messages · Yanming Di, Duncan Murdoch, Hadley Wickham

1 day later
#
On 12-08-24 11:56 AM, Yanming Di wrote:
You can't easily do that.  Some base packages have a topic like 
?"grid-internal" where internal documentation is collected, but it is 
visible to users.
You could also attach the environment of an exported function (e.g. 
attach(environment(grid::unit)), to put the whole internal environment 
on the search list.  But I usually use the ::: notation.

Duncan Murdoch
#
The devtools package allows you to do load_all("path/to/package"),
which simulates installing the package and then loading it (but is
much faster, at the cost of being a somewhat imperfect simulation).
Because working with unexported functions is so useful during
development, it makes all them all available.  (And the development
version allows you to choose whether or not you want them available)

I typically generate documentation with inline source comments (using
roxygen2). If I want them to be turned into Rd files and accessible to
the user I use the roxygen comments (#'). If I just want them to be
available to me (and other developers), I just use # - then they're
available in the source, but not in the man/ directory.

Hadley