Is there a way to automatically update the documentation in an R package?

此生再无相见时 提交于 2019-12-19 17:34:53

问题


I used 'package.skeleton()' to generate .Rd help files a few months ago. I have edited these files, and I have also changed the functions, removed some functions, added others. Is there a function that automates updating the Rd files?

update

A nice package was just released called Rd2roxygen, it is described by the author Yihui Xie on his blog.

As the name implies, this package allows one to retroactively insert documentation currently contained in .Rd into .R files. Sounds like a promising approach for both learning roxygen and for converting packages currently in development to R packages. Woo hoo. Thanks Yihui!

Based on answers by Joshua and Yihui, the answer appears to be: roxygen allows automatic updating of Rd files etc based on changes in the source .R code, and if I am not using roxygen currently, Rd2roxygen can help me migrate.


回答1:


Rd2roxygen was designed to help package developers who have been "stuck" in the raw Rd files but want to switch to roxygen -- it can process Rd files and update the R scripts with roxygen comments. From then on, you can begin to enjoy the power of roxygen. So Rd2roxygen is not a direct answer, but it might help you with the transition.




回答2:


This doesn't specifically answer your question, but you may be interested in Roxygen.




回答3:


No, I don't think so.

But you could try re-running package.skeleton() for new or changed functions and then merge this by hand.



来源:https://stackoverflow.com/questions/4099963/is-there-a-way-to-automatically-update-the-documentation-in-an-r-package

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