Can RStudio automatically generate an roxygen template for a function?

五迷三道 提交于 2019-11-30 05:37:45

(Converting @Crops comment into a full answer)

In RStudio v0.99 there is a new option under the "Code" menu for .R files: "Insert Roxygen Skeleton". There is an image of it in RStudio's blog post about v0.99 preview.

The silence that followed your question should tell you something... The answer, currently, is NO is doesn't. I know of several people who use EMACS for precisely this reason, and would not consider switching to RStudio until that has full roxygen support. That said, there has been some discussion about this between users and the makers of RStudio. Considering all the cool things that have been added to RStudio recently, I would not be surprised to see it happen. In fact, I think it is quite likely it will happen. But don't hold your breath for it, it may be a long wait...

Alternatively you can use the R package RoxygenReady to create Roxygen skeletons / Roxygen templates.

My solution was to use a text expander (PhraseExpress in my case) to do this.

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