Inline package overview documentation using roxygen

流过昼夜 提交于 2020-01-02 10:02:50

问题


I imagine this is a simple thing that I keep overlooking in the documentation, but I can't seem to figure out how to get package-level documentation to work in R. I'm not referring to function or class-specific documentation, but the documentation that you get when you type, for example, ?stats.

I've followed the general instructions I've found on the web, creating a sckeleton documentation file saved as .R. The .R file is copied with the package scripts, but the help documentation doesn't get made into a .Rd file (unless I add a function definition also named after the package).

An example of what I've tried:

#'_PACKAGE
#'MyPackage
#'
#'MyPackage description
#'
#'MyPackage details
#'@alias{MyPackage}
#'@alias{MyPackage-package}

I'm having a hard time finding good examples of how to set up general package documentation, for some reason. I've written quite a few function help files, and I know my package help file is being found by roxygen, but it's unclear why I can't generate an .Rd from it.


回答1:


Answer courtesy of @slickrickulicious in the comments above:

I needed to add NULL at the end of my documentation file and include '@name MyPackage'. Doing so generated the package help file correctly.



来源:https://stackoverflow.com/questions/34439970/inline-package-overview-documentation-using-roxygen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!