Lesson 11 of 27
roxygen2: In-Line Documentation for R
For this section of the course, you’ll need the materials in this GitHub repo. You can download or clone them. After you download or clone the materials from the GitHub repo for this section of the course, open the entire project by clicking 03_avalanchr.Rproj.
Your Turn 1
- Open the NAMESPACE file. What do you see?
- Let’s add documentation. Run use_roxygen_md()
- Open r/themes.R. Insert a roxygen skeleton for theme_avalanche().
- Change the title to “AVALANCHE ggplot2 themes”
- Hit Enter/Return twice after the title. Make sure the new lines start with #’.
Add this text: “Minimalistic ggplot themes for use on AVALANCHE reports.”
- Run document() or press Ctrl/Cmd + Shift + D.
Read the help page for your function with ?theme_avalanche.
- Finally, look at the NAMESPACE file again. What changed?
The R Packages book has a chapter on adding documentation. You might also be interested in the Getting Started with
Have any questions? Put them below and we will help you out!