Chapter 16 Function documentation

Learning objectives:

  • Describe the benefits of well developed function documentation
  • roxygen2 basics
  • Discuss the definition of object documentation
  • Demonstrate the object documentation workflow
  • Discuss some general formatting and style guidelines

16.0.1 Why care about object documentation?

  • Documentation is an important component of packages
    • How will users know how to use your package?
    • Inform your future self
    • Inform other contributors

16.0.2 roxygen2 advantages

  • code and documentation co-located
  • use markdown rather than learning the markup language of .Rd
  • automation of .Rd boilerplate
  • tools for sharing content across documentation topics and vignettes