从 R 包手册中排除函数
Exclude function from R package manual
我正在编写一个 R 程序包,并且正在使用 roxygen2 记录我的所有函数。但是,我不希望所有功能都出现在包的手册中。 如何指定哪些功能应该出现在软件包手册中,哪些不应该出现?
我知道用一个前导点命名一个函数,例如.f <- function()
而不是 f <- function()
是一个解决方案。还有其他解决方案吗?
我在 Hadley Wickham 的优秀著作 R packages 中遗漏了以下细节(在对象文档部分):
@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.
因此,将 @keywords internal
添加到 roxygen2 函数文档会导致该函数未出现在包中 manual/index,同时仍然使帮助页面在加载包后仍可访问。
我正在编写一个 R 程序包,并且正在使用 roxygen2 记录我的所有函数。但是,我不希望所有功能都出现在包的手册中。 如何指定哪些功能应该出现在软件包手册中,哪些不应该出现?
我知道用一个前导点命名一个函数,例如.f <- function()
而不是 f <- function()
是一个解决方案。还有其他解决方案吗?
我在 Hadley Wickham 的优秀著作 R packages 中遗漏了以下细节(在对象文档部分):
@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.
因此,将 @keywords internal
添加到 roxygen2 函数文档会导致该函数未出现在包中 manual/index,同时仍然使帮助页面在加载包后仍可访问。