1  Philosophy

I first learnt to write an R package from [Hilary Parker’s famous blog post, “Writing an R package from scratch”. Then I consulted Hadley Wickham’s “R packages” book (1st edition). I consider the “R packages” book (now in its second edition, by Hadley Wickham and Jenny Bryan), to be the authority on best practices for package development, alongside the rOpenSci guide, “rOpenSci Packages: Development, Maintenance, and Peer Review”.

These are excellent pieces of reference test, however I think there is a need for a resource that sits somewhere between a blog post on making an R package, and resource. I want something that contains just enough information to get you started on the right path to making an R package. This is what that book represents to me. Along the way I’ll include breadcrumbs to other resources to look into when you want to learn more.

This book also represents my efforts to explain the key parts of what I think people should know about how to write functions, and also to format this in a teachable way that can be covered in a single workshop.

So, why write a book?

Similar to my book, “Quarto for Scientists”, writing this as a book provides a nice way to structure the content in the form of a workshop, in a way suitable for learning in a day. It is not to say that there aren’t already the resources out there; there are. It is instead adding to the list of other (useful, hopefully!) information out there on the internet. To answer a question with another question: “Why NOT write this as a book?”