我在我的软件包中有一个Rcpp模块,除了公开类之外,还公开了一些方法。是否有可能使用roxygen2来记录(C++端)的这些方法? 我的模块看起来像这样:
RCPP_MODULE(BayesFst) {
using namespace Rcpp;
class_<BayesFst>( "BayesFst")
.default_constructor("Standard constructor")
.method("printData", &BayesFst::printData)
.method("printCounts", &BayesFst::printCounts)
.method("printInitialPvals", &BayesFst::printInitialPvals)
.method("printFstSummary", &BayesFst::printFstSummary)
.method("run", &BayesFst::run)
.method("setData", &BayesFst::setData)
.method("setPriorParameters", &BayesFst::setPriorParameters)
.method("setRunParameters", &BayesFst::setRunParameters)
.method("ldiriTest", &BayesFst::ldiriTest)
.property("interaction", &BayesFst::getInteraction, &BayesFst::setInteraction)
;
我希望能够记录下所有这些方法。一个简单的想法是将类隐藏在包装函数后面,然后从R包装函数内调用这些方法,但这种方式对我来说感觉有点不太优雅。
我尝试在函数中添加roxygen注释行,但由于它们没有以相同的方式导出,因此似乎无法捕获文档。
roxygen2
吗?实质上,你在R/
目录中进行编辑,调用它并且它会写入和/或更新man/*Rd
文件。所以这就像是编辑代码——你改变了包的准备工作,使其成为一个新的(次要或主要)版本发布。有很多工具也可以帮助你——看看一些教程吧。 - Dirk Eddelbuettel无法加载模块"myModule":初始化模块指针失败
。R 版本为 3.5.1,Rcpp_1.0.0,roxygen2_6.1.1,devtools_2.0.1。 - Egus