Session Ready
Exercise

Documenting data objects

If you include a data set in your package you must also provide documentation for it. As with package level documentation, you should include a title and description.

With a data set, once again, there is no function object to document. You instead give the name of the dataset as a character string, for instance "airquality". Additionally there are two tags that you need to use:

  • @format to describe the format of the data. This is often used with the describe format.
  • @source to identify where the data came from.

You should then save the package documentation in the R directory with a suitable name (in the above case, either airquality.R or data.R).

The weather dataset is available in your workspace. Run print(weather) to view it.

Instructions
100 XP
  • Update the @format tag to include the correct number of rows and columns in weather.
  • Add descriptions of all columns in the weather dataset that you added to your package in the last chapter.
  • Add a @source tag to and describe the data as "Randomly generated data".