Skip to content

Instantly share code, notes, and snippets.

Last active November 7, 2018 19:38
What would you like to do?
"R Packages" by Hadley Wickham, Abridged

R Packages, Abridged

Consider completing "Advanced R, Abridged" and "Git 101 Exercises" first.

"Advanced R" by Hadley Wickham is widely considered the best resource to improve your knowledge at building an R package. This guide is designed to give you the most essential parts of R Packages so that you can get going right away. It still will take a long time, but not as long.


  1. Read the following chapters of "R Packages" by Hadley Wickham:

Trivia Exercises

  1. What are the three requirements when naming an R package?
  2. Why is it a bad idea to name your package with a "."?
  3. What is the difference between devtools::install_github and install.packages?
  4. What is the difference between Suggests and Imports?
  5. What is the importance of dontrun?
  6. Why do packages have versions?
  7. What does moving from v1.0.1 to v2.0.0 mean? What does moving from v1.0.1 to v1.0.2 mean?
  8. What does v1.0.1.9000 mean?

Simulation Exercise

Write a package with a function called mean_impute that takes a vector that can contain NAs and returns a vector with the NAs imputed with the mean of that vector. Make your package available open source on your GitHub so people can use it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment