Over the past few months, there have been several glowing reviews of The Art of R Programming by Norman Matloff, which led me to give it a go and buy it for my Kindle. I’ve just finished reading it and am adding to that list of glowing reviews.
Having been using R in varying amounts over the past three years, my approach has typically been task orientated, learning as I go and using resources like the R Mailing List, Stack Overflow, Google and the vignettes and help files. This has sometimes led to banging my head against a wall for several hours, but ultimately I’ve learnt quite a bit about the language.
As I move more into writing functions, building packages and thinking about developing GUI widgets that sit on top of R, this has meant understanding more about the different data structures in R and starting to get an appreciation for things like S3 and S4 classes.
I’ve found reading the book a very enjoyable experience – to summarise, it is well written, builds the foundations from the ground up and provides good examples throughout to really illustrate the ideas and concepts that are being discussed.
The early chapters look at the various data classes in R, starting off with Vectors, before moving into Matrices, Arrays, Lists and Data Frames, giving good insights into all of these and an appreciation of when they can be used. The middle chapters focus on more advanced topics like writing functions, running simulations, string manipulation and graphics. Later chapters focus on advanced topics like parallelisation and debugging.
There is a big emphasis on the benefit of writing efficient code, either from a speed perspective or from a memory allocation perspective, and it really highlights where vectorisation can be used to solve a problem. I’m now a better programmer in R than I was before using it and am applying the concepts that I’ve learnt day in, day out.
Although still getting my head around some of the more advanced concepts in the book (it will be a while until I’m writing my own C code to improve the performance of an R function!), it has worked well as both front to back read and will work well in the future as a reference book. If you’re in a similar boat to me, having learnt R in a relatively unstructured way, I’d highly recommend it – at £16 for the Amazon Kindle edition, it’s great value for money.