Jump to ratings and reviews
Rate this book

The Art of R Programming: A Tour of Statistical Software Design

Rate this book
R is the world's most popular language for developing statistical Archaeologists use it to track the spread of ancient civilizations, drug companies use it to discover which medications are safe and effective, and actuaries use it to assess financial risks and keep economies running smoothly.The Art of R Programming takes you on a guided tour of software development with R, from basic types and data structures to advanced topics like closures, recursion, and anonymous functions. No statistical knowledge is required, and your programming skills can range from hobbyist to pro.Along the way, you'll learn about functional and object-oriented programming, running mathematical simulations, and rearranging complex data into simpler, more useful formats. You'll also learn –Create artful graphs to visualize complex data sets and functions–Write more efficient code using parallel R and vectorization–Interface R with C/C++ and Python for increased speed or functionality–Find new R packages for text analysis, image manipulation, and more–Squash annoying bugs with advanced debugging techniquesWhether you're designing aircraft, forecasting the weather, or you just need to tame your data, The Art of R Programming is your guide to harnessing the power of statistical computing.

569 pages, Kindle Edition

First published August 22, 2011

170 people are currently reading
1028 people want to read

About the author

Norman Matloff

9 books7 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
215 (36%)
4 stars
226 (38%)
3 stars
104 (17%)
2 stars
21 (3%)
1 star
20 (3%)
Displaying 1 - 30 of 32 reviews
Profile Image for Michael.
163 reviews73 followers
December 21, 2011
First things first, this book really lives up to its name! It’s a thorough introduction to programming in R, aimed at software developers. This is not the book for you if you want to learn about the statistics side of R or how to make prettier plots, there are plenty of books about that anyway.

What I really like is that the author never tries to “sell” R to the reader. This is rather refreshing, because I always get turned off when books start with a sales pitch for something I already clearly showed interest in by purchasing the book. R is a rather specialized language and chances are that you know why you want to solve a given problem in it, and if you don’t, this might not yet be the book you should be reading anyway. The first few chapters cover the language’s basic data structures like vectors, matrices, arrays, lists and tables, before chapter 7 introduces various flow control structures. What follows is a chapter on doing math and simulations in R, which is not overly long but gives some good examples of what the language is useful for. The next chapter is very interesting, it deals with R’s object oriented features and describes the differences between S3 and S4 classes as well as their respective up and down sides. After this the author covers input/output, dealing with strings and R’s graphing capabilities. He never gets lost in detail, but provides you with enough info to be able to explore these areas on your own. What really makes the book special though are the last few chapters, where Matloff covers debugging (a topic he also wrote an entire book about), performance tradeoffs, interfacing R with other programming languages (using functions written in C/C++ from R, as well as using R in Python) and various approaches to parallelizing R. While none of this may sound super exciting at first — apart from parallelism maybe — these are important issues in the daily lives of software developers and way too many books only gloss over them.

Now for some criticism: personally I don’t find the author’s style very engaging, it’s rather dry and boring at times. Since it’s clear that Matloff is an absolute authority on the topic of R this doesn’t way too heavily, but still deserves a mention. Also for my personal taste there are slightly too many forward references in the text, although that’s hard to avoid if you want to properly cover a language. I also found it rather odd that at one point the author mentions that explicit return statements aren’t exactly idiomatic in R, but that he will keep using them for the benefit of readers unaccustomed to the language. Given that this was a few chapters in, it would have been a perfect spot to switch to the more idiomatic style from then on, but maybe that’s just me being nitpicky. I also noticed several little typos and misspellings, something I’m not really used to from No Starch Press.

All in all this is a very solid book, which you definitely should pick up if you want to learn programming in R!
Profile Image for Vysloczil.
118 reviews72 followers
Currently reading
January 20, 2020
In 2020 this title is slightly outdated, but still a must read if you want to up your R game. If you think about buying one book at a good price, then get this one and complement it with the free online version of Hadley Wickham's Advanced R (now in version 2!).
Be aware that for some of the problems there are better solutions around already, most importantly:
* for the connection with python there is now the reticulate package
* for parallel computing much changed
* through Hadley's dplyr and stringr (and some other packages like purrr when it comes to functional programming) much better and smoother solutions are around for common problems
3 reviews
July 23, 2021
Really bad book. Very basic and ordinary. There is much better material available online for free.
Profile Image for Philipp.
687 reviews222 followers
January 12, 2014
If you're looking for a book to read as a full-on introduction to R (and advanced R), take this book.
Not only does it go through all of the basics of the language, it also recommends some modern packages which make everything easier (plyr for example) - with copious examples and "advanced examples".

I only have two problems with the book:

1) Sometimes, the advanced examples are too clever for their own good. They're meant to exhibit the advanced usage of the main focus of the current chapter, but they so often do something exceedingly clever that you first have to go through the code step by step with a piece of paper to understand the basic algorithm. Only then can you go on and understand the usage of the data-structure or control-structure in question.
2) It can't decide whether it's an introduction or a reference. The book is written and structured like an introduction, but it seems to be on a quest to introduce the majority of standard functions that R has (and they are legion). I'm pretty sure I already forgot about 80% of the introduced functions.
3 reviews
December 27, 2022
I am big fan of Norm's blog since 1995 and glad to read this book. Really liked it. You guys should follow Norm's blog - He was the one who understood brilliance of us and called Prasad Kothari not a next Nobel laureate in a very clear public way and that's the way these guys should be treated - my group of friends found the original article here - http://www.kermitrose.com/jgo/Econ/Ne... We wanted to make sure that Kothari leaves the profession forever. I am buying 100 copies of Norm's book.
Profile Image for Tassos.
128 reviews6 followers
February 19, 2020
Although I did not read from cover to cover, and I mainly skimmed through the chapters, I can say that this is an excellent introduction to R for beginners and even moderate R users.
Profile Image for Roberto Rigolin F Lopes.
363 reviews107 followers
July 28, 2017
You are about to get superpowers by mastering this art. As a result, the digital world will look quite different. Big blobs of bytes are suddenly playgrounds. You will load "whatever" to your vectorized universe just like creating a swimming pool with many many lanes. Then you deploy your mighty sharks (statistics?) to fetch the sexy stuff hidden. If you don't feel like swimming today, just fly, run, crawl, dance… this R thing is so flexible that you can even throw numbers in the air like a mad magician (wait a second… writing a FUNction for that).
Profile Image for Adam Wiggins.
251 reviews115 followers
January 14, 2013
Like most programming books, this one focuses too much on syntax and data structures, and not enough on problems you can solve with the language. But other than that it's well-written. If you want to do anything having to do with statistics, R is a great language, and this book will teach you how to use it.
Profile Image for Paul Abernathy.
56 reviews1 follower
August 9, 2014
This was my first R book. I worked through a good bit of it but still felt that there was a lot missing in my understanding of R. Something about the way it is organized or the way it explains things didn't quite do it for me. I ended up getting another book that explained R a lot better to me. I still refer to this book on occasion but I have found R in Action to be much more helpful.
228 reviews6 followers
September 2, 2017
This book IMHO is an excellent starting point for learning R. I'm finding it really useful for beginners like me to learn this new programming language. The book is comprehensive and well-illustrated.

The initial chapters talk about the foundation concepts like vectors and matrices. The examples are simple enough to start with, while the author leaves some room for self-experimentation. The latter chapters describe the advanced capabilities like graphics, debugging and performance tuning.

Needless to say, I'll require a lot of practice to get comfortable thinking in R terms, but this book definitely laid the stepping stone for me.
Profile Image for Terran M.
78 reviews103 followers
March 22, 2018
I found this book to be pedagogically excellent with well-considered ordering and progression and a cogent conceptual presentation. Note that this book covers the core R language, data structures, and some utilities - it does not cover model fitting and it has only a very cursory treatment of the base graphics. This is an excellent first book on R, since one can't do much without understanding the language itself, but it must be supplemented by other books on ggplot2 or lattice for graphics and separate books for analysis.

This book is primarily a tutorial. The index is of mediocre comprehensiveness so I cannot recommend it as a reference book.
Profile Image for Ren.
789 reviews9 followers
June 18, 2024
This is... Fine. I think I wanted more actual exercises out of it, and less just examples. There are tons of them, though, so if you learn through demonstration and reading this is absolutely the book for you! Unfortunately this one is a little incompatible with my learning style, so it didn't really work for me.
1 review
September 9, 2017
This is one of the best books for learning R. I have read numerous R books and this is my favorite. It is also the preferred text of students who work under me. They are constantly borrowing my copy of this book.
37 reviews
June 8, 2018
A good book, telling you stuff you won't learn from man pages and websites
Profile Image for Yuan.
31 reviews1 follower
February 24, 2020
I learned R in a very piecemeal fashion, via learning packages and using functions inside. Somehow I feel all the packages are isolated islands, I have trouble to “glue” them or understand why they were designed in such ways. Especially I ran into a lot of WTF errors when manipulating vector, list, array, matrix, data frame, factor and tables with the package functions. These very basic concepts in R (e.g. vector, matrix, array, list, data frame, factor) can be very tricky. This book will clear all these confusions for you, and provide you a very systematic way to study R programming with very simple examples. A must-read! The first 7 chapters are greats. I skipped the parallel programming and debugging chapters.
Profile Image for Arthur.
96 reviews5 followers
August 5, 2014
Well, I read somewhere, an opportunity for publishing a review online is a tribune for a fool. I will exercise my right whether you agree or not. I don't.
In short, overall, it is a worthy book. It touches most of the aspects when programming in a modern, Big Data capable language R. And not quite at the same time. To elaborate more, let me state right away this is not Norman's fault. Its R's. Carry on. Starting from the first pages till the last you will be made very well aware that R is slow. I was even annoyed by the constant reminders, however I did not deduct the star for that. I must tell you even before buying this book I did some research and found out that Julia (julialang.org) is a way better designed statistics programming language, alas it stuck at the RC 0.3 level for too long and apparently there is no good literature to learn it (yet, as I know of a new book in cooking). Did I say this book was highly recommend? Yet, it seems that the R buzz has penetrated all the Big Data remote corners (err, I mean cubicles). R remains valuable, coming out the academia to mere mortals.
So, an R programmer will benefit from knowing C, GPU, sockets and threads, will spend time debugging in an editor or shell and take on code performance optimizations. Not for a timid soul.
The book is not going to make your a totally ready to go and program, but it will prepare a solid background for the further R exploration. This book needs to be read among the first. I found the comprehension is too shallow to mark it five stars.
One advice to the author and publisher, the book needs a second edition, refresh.
Profile Image for Matija.
93 reviews24 followers
October 15, 2016
There is much that I didn't like about this book. Programming examples in the first two thirds of the text are mostly irrelevant and contrived, like doing quick sort by hand, or calculating probabilities by basic arithmetic operations. R is treated as a general purpose programming language, and almost no direction is given in how any real world statistical code would be written in it. Some good insights are provided on how R works, or how it's different from what programmers coming from other languages might expect, but in my opinion not enough to warrant a book. The text is often imprecise and hand-wavy (e.g. something like - I paraphrase: "this approach will generally work well, but sometimes R will not optimize some parts well, so you have to be careful"), and I often had the feeling that long pieces of code and subsequent code reviews were provided with no good reason.

Having thus driven this book to the ground, I have to say that professor Matloff seems very knowledgeable in R internals, C and C++ programming and various kinds of parallel and high-performance computation - all subjects treated in the final third of the book. I weren't looking for those in a book called "The Art of R Programming", but they were somewhat interesting. If these subjects interest you, you might find some good information in this book (but beware the first two thirds). If you are looking for a good book to learn R, pick up something else. By no means should you read this as your first book on R - I wouldn't be learning it now if this was my first book on it, as it gives absolutely no justification why it's worth the time.
Profile Image for Peter.
5 reviews2 followers
April 24, 2012
This book is more of a CS text than a stats text and the author makes this very clear. Regardless, it is a very good overview of R's data types and features. Great emphasis is placed on performance and properly vectorizing code witha brief overview of useful vectorized functions. The debugging section is more readable than Chamber's "Software for Data Analysis", but not as complete. The author recommends his own book for better understanding of debugging. There is a useful section on integrating R and Python using RPy, which I found very useful.

Overall, I found the book very useful. I previously had fairly extensive knowledge of general R syntax and functions, but this text was good for getting a slightly more formal and in depth run through of various R quirks. Definitely one of the best books on R.
Profile Image for Ben Smith.
13 reviews
December 4, 2015
This book provides a good R overview and I did enjoy it. That said, I will point out two perceived flaws. First, some of the examples involve an underlying mathematics and statistics knowledge. I didn't spend the time to try to research but would have like an overview in some places. Secondly, perhaps compounding this, example data is available for only a small set of problems. This does make it difficult to follow along.
Profile Image for Zoomikag.
13 reviews21 followers
May 18, 2015
This book introduces with the fundamental data structures like vectors,factors, matrices, dataframes, lists, etc. with a chapter dedicated to each. Book serves the purpose to introduce the programming structure to those new to R.

After getting good at the basics of R, one can go for other books for specific requirements (like whether you want to focus on graphics/plots or on statistical modelling).
Profile Image for Earo.
23 reviews
July 20, 2013
LIKE: 1) It takes readers from non-programming background on a wide range of topics from data structures to parallel. Esp, vectorization is the core art of R. 2) Extended examples (functions) are very practical. UNLIKE: 1) No exercise at the end of each chapter. 2) Variable & function names aren't that readable. Lots of abbreviation involved.
Profile Image for Michael Bond.
159 reviews4 followers
October 12, 2013
This book is very serious. It gets you way beyond the beginners books, and in fact, there is more material than I need here, but it is what I asked for. It does an exceptional job explaining how to think about vectorized programming, which is one of the big shifts for typical programmers.
Profile Image for Goo.
187 reviews
September 12, 2020
I read some of this when first learning R. This book is more like a conventional book for learning a programming language, whereas most introductory R books are an introduction to doing statistical data analysis using R while skipping the technical details of the language.
Profile Image for Matt Yancey.
10 reviews1 follower
October 20, 2012
This is a great resource for anyone that is looking at learning R. The strengths of this book come from it's examples and great organization.
14 reviews1 follower
August 14, 2016
This is a great introduction to base R and also a good reference for some more intermediate-advanced topics (vectorization, paralellization, etc.). The writing is very clear and accessible.
Displaying 1 - 30 of 32 reviews

Can't find what you're looking for?

Get help and learn more about the design.