Turn your R code into packages that others can easily download and use. This practical book shows you how to bundle reusable R functions, sample data, and documentation together by applying author Hadley Wickham’s package development philosophy. In the process, you’ll work with devtools, a suite of R functions for automating common development tasks. Devtools encapsulates best practices that Hadley has learned from years of working with this programming language.

Ideal for developers, data scientists, and business analysts, this book starts you with the basics and shows you how to improve your package writing over time. You’ll learn to focus on what you want your package to do, rather than think about package structure.

  • Learn an R package’s most useful components, including vignettes and unit tests
  • Automate anything you can, and do as much as possible with functions
  • Get tips on good style, such as organizing functions into files
  • Streamline your development process with devtools
  • Submit your package to the Comprehensive R Archive Network (CRAN)
  • Learn from a well-respected member of the R community who created 30 R packages, including ggplot2