Can RStudio automatically generate an roxygen template for a function?

前端 未结 4 2038
执笔经年
执笔经年 2020-12-29 18:26

Does RStudio support any automated roxygen template creation?

In Emacs-ESS, C-x C-o will produce an roxygen template for a function. For example, it wi

相关标签:
4条回答
  • 2020-12-29 19:03

    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...

    0 讨论(0)
  • 2020-12-29 19:04

    (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.

    Roxygen skeleton menu image from RStudio

    0 讨论(0)
  • 2020-12-29 19:07

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

    0 讨论(0)
  • 2020-12-29 19:22

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

    0 讨论(0)
提交回复
热议问题