Welcome

The goal of this book is to help you write better R code. It has four main components:

  • Design problems which lead to suboptimal outcomes.

  • Useful patterns that help solve common problems.

  • Key principles that help you balance conflicting patterns.

  • Selected case studies that help you see how all the pieces fit together with real code.

It is used by the tidyverse team to promote consistency across packages in the core tidyverse. But you can also use it to guide the design of your functions and packages to create interfaces that feel “tidy”, and fit in natural with other code that uses tidyverse idioms. It is a complement to http://style.tidyverse.org, which focusses on low-level code formatting.

This book will be under heavy development for quite some time; currently we are loosely aiming for completion in 2020. You’ll find many chapters contain disjointed text that mostly serve as placeholders for the authors, and I do not recommend attempting to systematically read the book at this time.