---
layout: post
title: "Using Roxygen2 to document functions in an R package (CC293)"
blurb: "Documenting R functions with Roxygen2"
author: "PD Schloss"
date: 2024-07-08 9:00
comments: false
youtube: bdKm51i_J8qyxIAMVs8GP8
start_hash: cc51a6620b3e11f74aeae843444b925762ced547
end_hash: b361e8a6e1fab5c25d942cd5f54187f45a13b7b0
---

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.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/phylotypr/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/phylotyprr/tree/{{page.end_hash}})
