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

Exercise

Building an R package

Once you have created the correct structure, included all of your functions, created the package documentation and ensured that the checks pass you can then build your package so that it is in a shareable format.

You can build your package using the build() function from devtools. You can use this function to build either a source version of the package, or a Windows/Mac specific binary version. The source version of the package will have a file ending of ".tar.gz" and the binary will take the ending ".zip" (Windows) or ".tgz" (Mac). You can only build binaries for the current platform that you're using. The build() function builds the source version of the package by default.

Instructions

100 XP
  • Build the source version of the datasummary package.
  • Look at the contents of the current directory using dir() to see the built version of your package.