Preface

Welcome!

Welcome to 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.

If you’re familiar with the first edition of the book, this preface describes the major changes so that you can focus your reading on the new areas.

There are several main goals for this edition:

  • Update to reflect changes in the devtools package, specifically, its “conscious uncoupling” into a set of smaller, more focused packages.

  • Expand coverage of workflow and process, alongside the presentation of all the important moving parts that make up an R package.

  • Cover entirely new topics, such as package websites and GitHub Actions (GHA).

All content has been completely revised and updated. Many chapters are new or reorganized and a couple have been removed:

  • New Chapter 1, “The Whole Game” previews the entire package development process.

  • New Chapter 2, “System Setup” has been carved out of the previous Introduction and gained more detail.

  • The chapter formerly known as “Package Structure” has been expanded and split into two chapters, one covering ...

Get R Packages, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.