Using Roxygen2 to document functions in an R package (CC293)

July 8, 2024 • PD Schloss • 1 min read

Including documentation for the functions in your R package is critical to helping end users use your package. Documenting your code can easily be done using Roxygen2. In this Code Club, Pat uses Roxygen2 syntax to help document the functions in his phylotypr R package. Along the way, he refactors the code to improve the documentation and shows some tricks to improving the utility of the documentation. Documenting code isn’t the most fun part of package development, but it’s really important! This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.


You can browse the state of the repository at the