Rd2roxygen

Convert Rd to roxygen documentation

View the Project on GitHub yihui/Rd2roxygen

Functions to convert Rd to roxygen documentation. It can parse an Rd file to a list, create the roxygen documentation and update the original R script (e.g. the one containing the definition of the function) accordingly. This package also provides utilities which can help developers build packages using roxygen2 more easily. The formatR package can be used to reformat the R code in the examples sections so that the code will be more readable.

Translate Rd to roxygen comments

Use Rd2roxygen('path/to/your/package') to update the R scripts under the R directory. Other functions might be useful for individual files:

Utilities to run roxygen and enhance documentation

roxygen_and_build() (or rab() for short) runs roxygen2 and tries to reformat the examples code in the documentation using the formatR package.

Installation and documentation

You can install the stable version on CRAN:

install.packages('Rd2roxygen')

Or use the devtools package to install the development version:

library(devtools)
install_github('Rd2roxygen', 'yihui')

See the PDF vignette for examples:

library(Rd2roxygen)
vignette('Rd2roxygen')

Original scripts written by Hadley Wickham; improved and maintained by Yihui Xie.