Re: [Rd] how to keep the documents of private functions private

From: Hadley Wickham <hadley_at_rice.edu>
Date: Sat, 25 Aug 2012 15:47:16 -0500

> To provide some background, a more general question is how to manage unexported (private) functions in an R package. I need to call them during the developing phase or even after the package is released (e.g., for debugging purpose or they may be needed by new functions), but I donít want to export them (Iíd like to keep the number of exported (public) functions to a minimum and present the users with only the functions that they need to know.)

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

-- 
Assistant Professor
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 25 Aug 2012 - 20:50:29 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Sun 26 Aug 2012 - 11:10:40 GMT.

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

list of date sections of archive