Can Roxygen ignore non-user functions?

2019-02-09 05:29发布

I've just started playing around with the roxygen package and I've very happy with the results so far. However I was wondering, is there a way to specify to roxygen that it should ignore certain functions that are not user-accessible?

Specifically, I'd rather not have a .Rd file pop up because I'm using the .onLoad() hook in my package. This function is already documented in the base package so there's no reason for me to re-document it.

标签: r roxygen
3条回答
ら.Afraid
2楼-- · 2019-02-09 05:43

Well, I finally found and browsed the Roxygen-devel list at R-forge to see when this would be implemented, and it appears to already be in the version of Roxygen that is on CRAN. The key is to specify use.Rd2=TRUE when calling roxygenize(). Under this mode, Roxygen will skip creating documentation for any functions that are not preceded by Roxygen comments.

查看更多
贪生不怕死
3楼-- · 2019-02-09 05:45

Use the internal keyword field (i.e. @keywords internal) to remove the function from the documentation and make it available for experienced users only. Source: roxygen2 vignette.

查看更多
迷人小祖宗
4楼-- · 2019-02-09 05:46

This is on their to do list - in the next version, only functions with roxygen documentation will create man files.

查看更多
登录 后发表回答