R Cookbook for the Casual Dabbler (3rd Edition)

A practical guide for using R in analysis and visualisation
Author

Charles Coverdale

Published

March 3, 2026

Introduction

G’day and welcome to R Cookbook for the Casual Dabbler (3rd edition).

RCCD 1st edition was originally published in 2020 as a side project during the COVID-19 pandemic in Melbourne.

As I wrote in the midst of lockdown:

I use R a lot for work and for side projects. Over the years I’ve collated a bunch of useful scripts, from macroeconomic analysis to quick hacks for making map legends format properly.

Historically my code has been stored in random Rpubs documents, medium articles, and a bunch of .Rmd files on my hardrive. Occasionally I feel like doing things properly - and upload code to a repository on github.

It doesn’t take a genius to realize this isn’t a very sustainable solution - and it also isn’t very useful for sharing code with others. It turns out 2-years of lock down in Melbourne was enough incentive to sit down and collate my best and most useful code into a single place. In the spirit of open source, a book seemed like the most logical format.

RCCD1e had surprisingly good (and long-lasting reviews). Despite this, the code was a little clunky, and it pulled from many unstable packages. Over the next 5-years, the R language and community improved significantly.

At the start of 2025, I released RCCD2e. This 2nd edition added 4 new chapters, but most importantly updated functions to pull from more stable packages. LLM’s were just starting to take off, and this process was rapidly improved by the use of AI.

At the start of 2026, Claude Code launched onto the scene. This made an update of RCCD3e seem inevitable. Integrating AI models into the terminal has fundamentally changed the nature of coding. More art, less science.

Most notably in RCCD3e the book has been rebuilt in Quarto — the successor to RMarkdown — for better formatting, cross-referencing, and long-term maintainability. Additionally:

  • Worked examples have been updated to reflect modern best practice (and packages)

  • Incomplete chapters from RCCD2e have (finally) been finished.

  • Many a bug and typo has been fixed.

With the pace of AI model development continuing to accelerate, I suspect RCCD3e will be the last iteration of this book. I hope it remains useful for new learners of R.

Limitations

If you find a bug (along with spelling errors etc) please email me at charlesfcoverdale@gmail.com with the subject line ‘RCCD3e’.


About the author

Charles Coverdale is an economist working across London and Melbourne. He is passionate about economics, climate science, and building talented teams. You can get in touch with Charles on twitter to hear more about his current projects.