R Packages (2e)

Learn how to create a package, the fundamental unit of shareable, reusable, and reproducible R code.


Hadley Wickham and Jennifer Bryan


Welcome to the online version of the 2nd edition of “R Packages” by Hadley Wickham and Jennifer Bryan. Packages are the fundamental units of reproducible R code. They include reusable R functions, the documentation that describes how to use them, and sample data. In this book you’ll learn how to turn your code into packages that others can easily download and use. Writing a package can seem overwhelming at first. So start with the basics and improve it over time. It doesn’t matter if your first version isn’t perfect as long as the next version is better.

This website is and will always be free, licensed under the CC BY-NC-ND 4.0 License. If you’d like a physical copy of the book, you can order it on Amazon.