The full text of Chapter 01 can be downloaded here.
Thumbnails of the graphics in each chapter together with the code which created them are on these pages. You can download files for the complete code for each chapter from the links at the foot of this page. The files of code for each chapter include the lines defining the ggplot theme used throughout the book.
Code is provided by chapter and for each graphic individually. The graphics for the book were drawn with specified window sizes and aspect ratios, so the plots will need adjusting to get exactly the same graphic as in the book.
To avoid repetition some code chunks depend on code provided earlier in the same chapter. Colour settings are defined at the start of each chapter.
The code assumes you have the following packages loaded: