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

Exercise

Document your data

Documenting data in R package development is crucial as it provides essential information about the datasets included in the package. Proper documentation helps users understand the structure, content, and intended use of the data, enabling them to make informed decisions and effectively utilize the package's functionality.

Recall the distance_data data set you loaded into the package earlier in the course.

The testthat package and the unitConverter package at this point in development have been loaded for you. You are currently working in the R/distance_data.R file that was created with use_r("distance_data").

Instructions

100 XP
  • Update the heading to have a title of Distance values and units and a description of Distance values and corresponding unit (feet, meters, or inches)
  • Update the @format entry to be Data frame with two columns and 1000 rows.
  • Change the \describe portion to include value and unit as \items with Numeric distance value and Distance unit as information.
  • Add an @examples entry showing how to print distance_data and close the file with the name of the data in a string.