1. Learn
  2. /
  3. Courses
  4. /
  5. Developing R Packages

Connected

Exercise

Function documentation starters

The roxygen2 headers, included in the same script as the function code, use roxygen2 comments #' to identify the header lines. The first two comments (title and description) have special meaning and do not require tags, but must be separated by a new line. Keep in mind that the title provides a brief overview of the function's objective, while the description offers additional information and elaboration. For example:

#' My function title
#'
#' Its description

Instructions

100 XP
  • Add the title "Convert between distances" to your roxygen2 header.
  • Add the following short description of the function: "Performs the conversion based on specified unit_from and unit_to values."