有没有办法自动更新 R 包中的文档?

发布于 2024-10-01 08:53:24 字数 492 浏览 4 评论 0原文

几个月前,我使用“package. Skeleton()”生成 .Rd 帮助文件。我编辑了这些文件,还更改了功能,删除了一些功能,添加了其他功能。有没有自动更新Rd文件的功能?

更新

刚刚发布了一个不错的软件包,名为 Rd2roxygen< /a>,作者 Yihui Xie 在他的

顾名思义,该包允许将当前包含在 .Rd 中的文档追溯插入 .R 文件中。对于学习 roxygen 以及将当前开发的包转换为 R 包来说,这听起来是一种很有前景的方法。呜呼。谢谢一辉!

根据 Joshua 和 Yihui 的回答,答案似乎是: roxygen 允许根据源 .R 代码的更改自动更新 Rd 文件等,如果我当前没有使用 roxygen,Rd2roxygen 可以帮助我迁移。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

涫野音 2024-10-08 08:53:24

Rd2roxygen 旨在帮助那些一直“卡在”原始 Rd 文件但想要切换到 roxygen 的开发人员——它可以处理 Rd 文件并更新 R 脚本与氧气评论。从那时起,您就可以开始享受roxygen的力量了。因此,Rd2roxygen 不是直接答案,但它可能会帮助您完成过渡。

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.

生生漫 2024-10-08 08:53:24

这并没有具体回答您的问题,但您可能对 Roxygen 感兴趣。

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

走野 2024-10-08 08:53:24

不,我不这么认为。

但是您可以尝试为新的或更改的函数重新运行 package.sculpture() ,然后手动合并它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文