Functions

Writing a Family of Functions for Related Tasks

  1. Explain why you might want to write a collection of functions to perform tasks related to a single object.
  2. Describe good coding conventions for writing functions for:

Sourcing a File

  1. Compare and contrast an R Markdown file and an R script.
  2. Create an R script in RStudio.
  3. Give the file suffix for R Markdown files and R scripts.
  4. Source functions from an R script using source().

Function Documentation

  1. Explain why you should always (yes, always) write documentation for a function you write.
  2. State the three things (at the very least) you should document when writing a function header.
  3. Use roxygen-style formatting (that’s the #' stuff) to write header comments for a given function.