Using roxygen2 for package documentation

As seen before, the documentation of our package is very important but can also get very complex when our package reaches a certain size and number of different functions.

But an alternative to creating and editing all the documentation files on our own is using the roxygen2 package. It was developed by Hadley Wickham, Peter Danenberg, and Manuel Eugster.

The basic idea of roxygen2 is it to make it possible to describe functions directly in comments next to their definition in the code file. The roxygen2 package will then go through the code files and create the corresponding Rd files in the man folder.

Installing the roxygen2 package

The roxygen2 package is available on CRAN and can be installed in the R console ...

Get Mastering RStudio – Develop, Communicate, and Collaborate with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.