This repository contains the materials for "Level Up Your Package's Roxygen Documentation," a lightning talk at the satRday Chicago 2019 conference.
The roxygen2 package is the standard for writing documentation for R packages. While the basics are intuitive enough to copy from seeing anybody else’s package, roxygen2 has some advanced tricks that aren’t so obvious. This lightning talk will show some of those tricks, including dummy articles, section and parameter inheritance, and package articles.
Presentation:
The source for the examples from the talk are available in the demo package pokemon
. To install:
remotes::install_github("https://github.com/jayqi/satRday-roxygen-talk", subdir = "pokemon")
Then use the library
function to load the package:
library(pokemon)
- Generic Function Example
- Source: R/parameter_inheritance.R
- RStudio doc shortcut:
?get_pokemon_by_number
- Package Article
- Source: R/package_article.R
- RStudio doc shortcut:
?pokemon
or?pokemon-package
- Null Objects and
@rdname
- Source: R/null_object_and_rdname.R
- RStudio doc shortcut:
?translate_to_pokemon
,?translate_to_pikachu
,?translate_to_squirtle
- Parameter Inheritance
- Source: R/parameter_inheritance.R
- RStudio doc shortcut:
?whos_that_pokemon
- Section Inheritance
- Source: R/section_inheritance.R
- RStudio doc shortcut:
?Wartortle
Disclaimer: The author of this repository claims no ownership over Pokémon or related characters. Pokémon and all related characters are trademarks of Nintendo. The presentation and demo package uses Pokémon under fair use, and all materials should only be used for personal, noncommercial purposes.