如何记录R参考类? [英] how do I document an R Reference Class?
问题描述
如果我写了一个 Rd
如何记录参考类的成员函数的使用?
how do I document the use of member functions of a reference class?
文件与 \usage
块,如何避免警告
Functions/methods with usage in documentation object 'XmlDoc' but not in code:
$ new
我希望 \usage
块允许我写如下:
I'd expect the \usage
block to allow me write things like:
obj <- ClassName$new(par1, par2, ...)
obj$method1(oth1, ...)
然后我将在 \arguments
块。
如果我这样做, R CMD检查
抱怨
Assignments in \usage in documentation object 'ClassName':
,并且不会将方法识别为我需要的代码对象文档。
and does not recognize the methods as code objects I need document.
截至目前,我正在写 Rd
没有 \usage
阻止并在 \examples
块中写入上述代码,但是我没有地方可以记录参数,这样检查
实际上没有什么检查。由于我不满意,我现在向社区询问当前的常见做法。
as of now, I am writing Rd
files without the \usage
block and writing the above code in the \examples
block, but then I have no place to document arguments and this way the check
has very little to check actually. Since I'm not satisfied with this, I'm now asking the community about the current common practice.
推荐答案
不知道是否是正确的方式,但是我所做的是使用方法部分,然后将方法文档放在内部描述中。
I don't know if it's the Right Way, but what I've done is to have a Methods section and then put the method documentation in an interior describe.
这篇关于如何记录R参考类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!