Jump to ratings and reviews
Rate this book

R Cookbook: Proven Recipes for Data Analysis, Statistics, and Graphics

Rate this book
With more than 200 practical recipes, this book helps you perform data analysis with R quickly and efficiently. The R language provides everything you need to do statistical work, but its structure can be difficult to master. This collection of concise, task-oriented recipes makes you productive with R immediately, with solutions ranging from basic tasks to input and output, general statistics, graphics, and linear regression. Each recipe addresses a specific problem, with a discussion that explains the solution and offers insight into how it works. If you’re a beginner, R Cookbook will help get you started. If you’re an experienced data programmer, it will jog your memory and expand your horizons. You’ll get the job done faster and learn more about R in the process.

434 pages, Paperback

First published January 1, 2011

113 people are currently reading
680 people want to read

About the author

Paul Teetor

11 books3 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
162 (36%)
4 stars
172 (38%)
3 stars
89 (20%)
2 stars
14 (3%)
1 star
8 (1%)
Displaying 1 - 27 of 27 reviews
Profile Image for Louis.
226 reviews30 followers
April 23, 2011
A part of the cookbook series is expected to provide a multitude of examples of useful tasks. The R Cookbook does this, but also more. This provides more, teaching about R beyond what reference books and most tutorials.

One weakness of R compared to other data analysis environments and programming languages is it's lack of coherence that comes from a central design. Instead it seems like a set of constructs, each designed differently. As an example, the multiple packages for graphic. Every user of R soon picks up idioms from tutorials or trial and error. Book authors use their favorites. But the effect is that it is hard to know what you do not know. And one does not realize the realm of the possible.

The R Cookbook does this. In having multiple related recipes together what it provides are a number of closely related tasks, done in different ways. And using different idioms. And I have taken advantage of it, learning more ways of working with various data structures, the apply family of functions and other data transforms. This makes the R Cookbook even more valuable then the typical member of the O'Reilly Cookbook series. Well recommended.

I receive a free electronic of this book as part of the O'Reilly Blogger program.
More information on the book can be found at O'Reilly Press
228 reviews6 followers
October 14, 2017
I agree that this is not a book for the beginners, but nevertheless it started with the very basics. I was impressed about it though it is from a Cookbook series.

The approach in the book is: if this is your problem, here's the solution, followed by a discussion which provides great amount of detail about the concept or function. This format allows the book to be used as a reference guide as well as it will assist us to jump to a point directly. The book illustrates plenty of functions of R in this fashion.

There are parts of the book that educate us about Statistics itself, but prior knowledge of some Statistics is a must if you want to make the best of this book.

The author shows examples from a variety of libraries - MASS, Cars93, zoo, XML to name a few. Enthusiastic readers will explore the data sets in these libraries and become more hands-on. The chapter on Useful Tricks exposed many of the "helper" functions. These add to the convenience while working with R.

The code samples for the book seemed incomplete when I downloaded them. But this worked for my benefit in the sense that I spent more time actually writing the code or creating the data myself - helped me get a little more comfortable around it's syntax. Blessing in disguise I guess.
Profile Image for Joshua Hruzik.
17 reviews6 followers
November 28, 2014
If you love learning by doing this is your book!

R is the best statistical software package on the market (although it's free, so technically there is no market for it). Its functions outstrip those of SPSS and STATA by far. So naturally everyone doing statistical work should be familiar with R.

The R Cookbook is designed for clear cut problem solving. You want something being done by R? This book will have a description how to do it and a detailed section of what you are actually doing. This book will help you master the steep learning curve of R and within a short time you'll never want to go back to SPSS or STATA. A lot of the statistical techniques are explained in the detailed section, so even if you are relatively new to statistics you'll learn the most basic aspects by reading this book (I would strongly recommend a full stat intro)

If you are doing more sophisticated analysis you'd still have to check the internet for additional resources. This book covers the basics, but lacks some of the statistical tests (e.g. White's test). Once you know how to handle R, implementing additional statistical procedures shouldn't be a problem.
Profile Image for Darryl Pendergrass.
Author 1 book7 followers
December 29, 2017
Great R Reference Book

The book contains numerous recipes for addressing specific topics related to R. I found several solutions to topics that I have faced while using R. I found the coverage of solutions strike a good balance for beginning and advanced users. The author directs the reader to other books where necessary to learn more about specific topics.
Profile Image for Yanick Champoux.
Author 2 books4 followers
February 15, 2018
The recipes are short and start to the point. It however has the problem that not all basics and details of the syntax are explained. For example, at some point the notation "plot( x ~ y)" shows up without any indication of what the tilde does there. Good intermediate book, and would complement, but likely not replace, an introduction book.
Profile Image for Ohud Saud.
93 reviews4 followers
July 3, 2018
I love this book. Looking for your next great read, consider reading it. simple, clear and practical.
21 reviews
September 10, 2020
This book provides all the basics of R programming. I also use it as a encyclopedia/dictionary to refer back any R functions or methods quickly whenever needed.
Profile Image for Daniel Morgan.
714 reviews24 followers
January 3, 2021
This was a great guide to figuring out how to do basic statistical functions in R.
31 reviews1 follower
October 31, 2014
This is an excellent book on R. If you don't know anything about R, this isn't the book to start with. However, it will be really useful after you have learned some really basic concepts about R (basically, one week after you start learning R!).

The book consists of user-oriented tasks. The reader looks up the task they are interested in performing from the contents pages at the front of the book. So the book is designed as a reference book.

The strength of this book are:
** the range and number of tasks described (they include some really basic beginner's stuff right through to specific statistical analyses.)
** the explanations are easy to understand
** the explanations are full. By this I mean the reader who has never performed that task before can pick up everything they need to know to carry out that task themselves. For example, tips and illustrative examples are included.

This book has saved me a lot of time and head-scratching! However, it's not designed to be the only R book you'll ever need. It's a fantastic reference meant for beginners to intermediate R users. And you will learn a lot from it!
Profile Image for Samuel.
49 reviews6 followers
February 12, 2025
This has been a real "life saver" for me.

As a bioinformatician primary working in Python and some Go, R is not my day to day tool. At the same time I have needed to dabble in it multiple times during my career, and each time I have been pretty lost as I have typically forgot a lot of the weird caveats of R from last time I used it.

This book really helps in this situation.

Full disclosure: I haven't read the full book (which I guess is uncommon for cookbooks), but selected chapters based on whatever current problem I'm working on.
Profile Image for Glenn.
21 reviews1 follower
February 10, 2014
The R programming language is well suited for exploring correlation in medium size data sets. If you already understand the null hypothesis and know which algorithms are appropriate to use for statistical variance testing, then this book will really boost your productivity with R.

If you don't have much understanding of statistics and what purpose it serves, then this is not the first book that you should turn to.
Profile Image for Luís Gouveia.
Author 48 books17 followers
December 15, 2016
Como a maior parte dos livros da O'Reilly, este possui muitos exemplos e é bastante orientado para a prática e realização em computador das suas propostas de trabalho.

Constitui uma boa fonte para aprofundar o conhecimento desta linguagem de programação e programação de análise de dados / estatística, cada vez mais popular.

Possui uma página de recursos na Web que facilita a sua aprendizagem: http://www.cookbook-r.com/
Profile Image for Paul Boal.
6 reviews1 follower
January 27, 2013
As someone who isn't a practicing statistician I was blown away by how accessible and informative this cookbook was. I expected examples to be inaccessible, but the author educated me on both R and applied statistics at the same time.
Profile Image for Wouter.
17 reviews
October 20, 2011
Nice recipe reference for introductory statistics measures/tests.
Profile Image for Vladimir.
125 reviews4 followers
June 27, 2012
It is my Top-1 recommended book for people starting to study R. Concise and with very useful examples.
Profile Image for Karl.
221 reviews26 followers
December 7, 2012
Much better than "R in a Nutshell", even given what needs they're supposed to serve. Read this first if you're learning R (and already know some statistics).
Profile Image for Michael Bond.
159 reviews4 followers
June 19, 2013
Seems to cover just the right topics for a book of its size. To get more info on graphics or prorgamming, you may need additional books, but this is the ideal cookbook.
1 review
Currently reading
October 13, 2017
good book
This entire review has been hidden because of spoilers.
Profile Image for Scott Pearson.
820 reviews39 followers
February 10, 2019
I picked up this book with the intention of learning intermediate R. I was past the novice stage of learning the language, but I was still short of learning Advanced R. This book gave me the confidence to read R code more quickly and to understand more nuance in this (fun) language.

This book is written by a quant (Wall Street data analyst) who has Masters degrees in both statistics and computer science. I find his statistics section interesting and most helpful. His visualization section is dated as it should use ggplot instead of R's native plotting techniques.

He analyzes several helpful methods; figuring out those methods constitutes the learning part of the book. The short script (this is a computer cookbook after all) were helpful to extend my knowledge and agility with the language.

The statistics section consists of a plethora of helpful analytical techniques to get what you want out of R. The information in this section is unique to me and as such new/useful. It tells me what techniques to use for certain types of data (e.g., normal vs. non-normal). Short of a statistics textbook, that's all you can ask for from a computer script cookbook.

So this book served its purpose well. I would not classify it as essential R reading, however. There are other texts which are more important. Some of the scripts are obvious, but this book provided good reading while I was eating lunch for a couple of weeks.
Displaying 1 - 27 of 27 reviews

Can't find what you're looking for?

Get help and learn more about the design.