简体   繁体   中英

Exclude function from R package manual

I'm writing an R package, and I'm documenting all of my functions with roxygen2. However, I do not want all functions to appear in the manual of the package. How can I specify which functions should appear in the package manual, or which ones should not?

I am aware that naming a function with a leading dot, eg .f <- function() instead of f <- function() is a solution. Are there other solutions?

I had missed the following detail in the excellent book R packages by Hadley Wickham (in the section on object documentation):

@keywords keyword1 keyword2 ... adds standardised keywords. Keywords are optional, but if present, must be taken from a predefined list found in file.path(R.home("doc"), "KEYWORDS").

Generally, keywords are not that useful except for @keywords internal. Using the internal keyword removes the function from the package index and disables some of their automated tests. It's common to use @keywords internal for functions that are of interest to other developers extending your package, but not most users.

So adding @keywords internal to the roxygen2 function documentation results in the function not appearing in the package manual/index, while still making the help page be accessible after loading the package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM