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

Exercise

The use_* functions

Beyond the required structure you can include a number of additional directories containing elements such as vignettes (user guides), data and unit tests. The devtools package makes it really simple for you to add to the package structure by providing a series of use_* functions. For example, use_data() and use_vignette(). Note that when adding vignettes, it's best not to include any spaces in the vignette name.

When you are adding data you need to provide the name of the data object along with the argument pkg, giving the path to the package that you want to put your data in.

devtools is loaded in your workspace.

Instructions

100 XP
  • Using the dir() function, check what directories are currently in the package?
  • The weather dataset has been created for you. Add it to your package.
  • Add a vignette titled "Generating_Summaries_with_Data_Summary".