简体   繁体   English

使用`roxygen2`的内部帮助函数的文档

[英]Documentation of internal helper function using `roxygen2`

I am new to creating my own packages and I am using roxygen2 . 我对创建自己的程序包不roxygen2并且正在使用roxygen2

I am creating a package with a lot of internal helper functions and I was wondering if I have to document all of them. 我正在创建一个包含许多内部帮助器功能的程序包,我想知道是否必须记录所有这些功能。 I understand the importance of documentation but some functions are fairly simple and are just wrapper around other functions for convenience. 我了解文档的重要性,但是某些功能相当简单,为方便起见,它们只是包装在其他功能周围。 I have done a basic search of the web but I don't seem to be able to find a definitive answer. 我已经对网络进行了基本搜索,但是似乎无法找到确切的答案。

Any help is appreciated. 任何帮助表示赞赏。

It depends what you mean by "have to". 这取决于您“必须”的含义。 One interpretation is, "Do I have to document these functions to pass checks?" 一种解释是:“我必须记录这些功能才能通过检查吗?” The answer to that question is no. 这个问题的答案是否定的。 As long as the function isn't exported from the package, R CMD check won't require that you document it. 只要不从软件包中导出功能, R CMD check就不需要您对其进行记录。

Another interpretation is "Do I have to document it to help myself in maintaining this package?" 另一种解释是“我是否必须记录下来以帮助自己维护此软件包?” That question is harder to answer. 这个问题很难回答。 Some functions are so obvious that they don't really need any documentation beyond their name, eg a print method with no extra arguments beyond those of the generic. 有些功能非常明显,以至于它们实际上不需要名称之外的任何文档,例如,除了通用属性之外,没有其他参数的print方法。

Other functions aren't so obvious, or have arguments whose meaning isn't obvious. 其他功能不太明显,或者具有含义不明显的参数。 It's a good idea to document those if you plan to maintain your package for a long time, because you might forget the details between now and whenever a problem arises. 如果您打算长期维护软件包,最好将它们记录下来,因为您可能会忘记从现在到出现问题之间的详细信息。 And if you are releasing your package to others, you should plan on long term maintenance, because if it is useful, people will use it. 而且,如果您将软件包发布给他人,则应该计划进行长期维护,因为如果有用,人们会使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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