Dear all, I am currently creating a package and writing the documention files for some functions (the main functions). When using R CMD check myPackage, I get a warning message indicating that some of my functions are not documented. How can I get rid of this problem? Of course, I don't want to document every function in the package... Thanks for your help. -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269
You can create a myPackage-internal.Rd file where you only have to list the functions using \alias{}; see page 7 in "Writing R extensions". Function names starting with a "." are (currently) not detected in the check, so using .foo etc. for internals might be an option as well. Regards S?ren ________________________________ Fra: r-help-bounces at r-project.org p? vegne af Ardia David Sendt: ti 27-05-2008 15:30 Til: R-help at r-project.org Emne: [R] package functions documentation Dear all, I am currently creating a package and writing the documention files for some functions (the main functions). When using R CMD check myPackage, I get a warning message indicating that some of my functions are not documented. How can I get rid of this problem? Of course, I don't want to document every function in the package... Thanks for your help. -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 ______________________________________________ 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.
If this is for distribution on CRAN, you should have documentation for all functions. But, if these are "minor" functions and are used only to support the "major" functions I see two ways you could resolve this. 1) First option is to embed the minor functions within the major functions they support so that they do not exist globally. 2) You could delete the Rd-files for the minor functions in the "man" folder and then write a namespace file where you define the major functions which should be visible and save it in your package folder before you do R CMD stuff.> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Ardia David > Sent: Tuesday, May 27, 2008 9:30 AM > To: R-help at r-project.org > Subject: [R] package functions documentation > > Dear all, > I am currently creating a package and writing the documention > files for some functions (the main functions). When using R > CMD check myPackage, I get a warning message indicating that > some of my functions are not documented. How can I get rid of > this problem? Of course, I don't want to document every > function in the package... > Thanks for your help. > -- > David Ardia > H-building, room 11-26 > Econometric Institute > Erasmus University > PO Box 1738 > NL 3000 DR Rotterdam > The Netherlands > Phone: +31 (0)10 408 2269 > > ______________________________________________ > 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. >
The "Writing R extensions" pdf says the following on the matter: Note that all user-level ob jects in a package should be documented; if a package pkg contains user-level objects which are for ?internal? use only, it should provide a file ?pkg-internal.Rd? which documents all such objects, and clearly states that these are not meant to be called by the user. See e.g. the sources for package grid in the R distribution for an example. Note that packages which use internal objects extensively should hide those objects in a name space, when they do not need to be documented (see Section 1.6 [Package name spaces], page 19). Of course, the message is only a warning after all, so you could simply ignore it ;). Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 27, 2008, at 9:30 AM, Ardia David wrote:> Dear all, > I am currently creating a package and writing the documention files > for some functions (the main functions). When using R CMD check > myPackage, I get a warning message indicating that some of my > functions are not documented. How can I get rid of this problem? Of > course, I don't want to document every function in the package... > Thanks for your help. > -- > David Ardia > H-building, room 11-26 > Econometric Institute > Erasmus University > PO Box 1738 > NL 3000 DR Rotterdam > The Netherlands > Phone: +31 (0)10 408 2269
Ardia David <david.ardia at unifr.ch> writes:> Dear all, > I am currently creating a package and writing the documention files > for some functions (the main functions). When using R CMD check > myPackage, I get a warning message indicating that some of my > functions are not documented. How can I get rid of this problem? Of > course, I don't want to document every function in the package... > Thanks for your help.Adding a NAMESPACE file to your package allows you to separate functions that are visible to the end user (and hence requiring documentation) from those used purely internally to the package (and perhaps documented less formally). See the Writing R Extensions manual for details. This helps to provide the user with access to the relevant documentation, without too much clutter. It also helps you to structure your code to have a 'public' interface that should be well thought out and relatively unchanging, and more flexibly defined and used functions that are 'private' to your package. Martin> -- > David Ardia > H-building, room 11-26 > Econometric Institute > Erasmus University > PO Box 1738 > NL 3000 DR Rotterdam > The Netherlands > Phone: +31 (0)10 408 2269 > > ______________________________________________ > 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.-- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M2 B169 Phone: (206) 667-2793